diff --git a/tests/execute_notebook_code_test.py b/tests/execute_notebook_code_test.py index 1fc2a2341..0259d8f76 100644 --- a/tests/execute_notebook_code_test.py +++ b/tests/execute_notebook_code_test.py @@ -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.""" @@ -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()