Skip to content

Commit

Permalink
update test with no print
Browse files Browse the repository at this point in the history
  • Loading branch information
garyzhang99 committed Aug 2, 2024
1 parent 8df0f73 commit 460a60d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/execute_notebook_code_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def setUp(self) -> None:
self.arg1 = {"code": "import math\nprint(math.sqrt(16))"}
# No input code
self.arg2 = {"code": ""}
# test without print
self.arg3 = {"code": "1+1"}

def test_basic_expression(self) -> None:
"""Execute basic expression test."""
Expand All @@ -39,6 +41,12 @@ def test_no_input_code(self) -> None:
self.assertEqual(response.status, ServiceExecStatus.SUCCESS)
self.assertEqual(response.content, [])

def test_no_print(self) -> None:
"""Execute no print test."""
response = self.executor.run_code_on_notebook(self.arg3["code"])
self.assertEqual(response.status, ServiceExecStatus.SUCCESS)
self.assertIn("2", response.content[0])


if __name__ == "__main__":
unittest.main()

0 comments on commit 460a60d

Please sign in to comment.