From 839d5f869472219c4b9baa62b59bff2be4114c12 Mon Sep 17 00:00:00 2001 From: xuwenyihust Date: Thu, 4 Jul 2024 13:23:38 +0800 Subject: [PATCH] Refactor notebook creation API endpoint and model in test_notebook_service.py, and fix test_create_and_get_notebook test case --- server/tests/services/test_notebook_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/tests/services/test_notebook_service.py b/server/tests/services/test_notebook_service.py index c06d5b3..fd24848 100644 --- a/server/tests/services/test_notebook_service.py +++ b/server/tests/services/test_notebook_service.py @@ -40,9 +40,11 @@ def test_create_and_get_notebook(self): with self.app.app_context(): Notebook.create_notebook_with_init_cells(notebook_name='Notebook.ipynb', notebook_path='') - notebooks = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[0] + notebooks = json.loads(Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[0]) status_code = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[1] + print(notebooks) + self.assertEqual(status_code, 200) self.assertEqual(len(notebooks), 1) self.assertEqual(notebooks['name'], 'Notebook.ipynb')