expose shell metadata in call responses
This commit is contained in:
@@ -73,6 +73,20 @@ class AppTests(unittest.TestCase):
|
||||
self.assertNotEqual(first.call_id, second.call_id)
|
||||
self.assertEqual(second.result.result, 42)
|
||||
|
||||
def test_response_and_shell_list_expose_shell_info(self):
|
||||
app = App()
|
||||
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
call = app.run_code("1 + 1", shell_name="new")
|
||||
|
||||
shells = app.list_shells()
|
||||
|
||||
self.assertEqual(len(shells), 1)
|
||||
self.assertEqual(call.shell.shell_id, shells[0].shell_id)
|
||||
self.assertEqual(call.shell.name, call.shell_name)
|
||||
self.assertEqual(call.shell.execution_count, call.result.execution_count)
|
||||
self.assertIn("execute_result", call.shell.capabilities)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user