Skip to content

Commit f7ab8f2

Browse files
committed
Refactor notebook creation API endpoint and model to use 'name' and 'path' instead of 'notebookName' in test_notebook_service.py and fix test_create_and_get_notebook test case
1 parent b3fe006 commit f7ab8f2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

server/tests/services/test_notebook_service.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ def test_get_all_notebooks(self):
3838

3939
def test_create_and_get_notebook(self):
4040
with self.app.app_context():
41-
create_response = Notebook.create_notebook_with_init_cells(notebook_name='Notebook.ipynb', notebook_path='')
42-
# print(create_response)
43-
44-
print(Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[0])
45-
# notebooks = json.loads(Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb'))
46-
# self.assertEqual(len(notebooks), 1)
47-
# self.assertEqual(notebooks['name'], 'Notebook.ipynb')
48-
# self.assertEqual(notebooks['path'], 'work/Notebook.ipynb')
41+
Notebook.create_notebook_with_init_cells(notebook_name='Notebook.ipynb', notebook_path='')
42+
43+
notebooks = json.loads(Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[0])
44+
status_code = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[1]
45+
46+
self.assertEqual(status_code, 200)
47+
self.assertEqual(len(notebooks), 1)
48+
self.assertEqual(notebooks['name'], 'Notebook.ipynb')
49+
self.assertEqual(notebooks['path'], 'work/Notebook.ipynb')
4950

0 commit comments

Comments
 (0)