Skip to content

Commit

Permalink
Refactor notebook creation API endpoint and model in test_notebook_se…
Browse files Browse the repository at this point in the history
…rvice.py, and fix test_create_and_get_notebook test case
  • Loading branch information
xuwenyihust committed Jul 4, 2024
1 parent a4c882d commit b4d3187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/app/services/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def create_notebook_with_init_cells(notebook_name: str = None, notebook_path: st
json=data
)

return response.json()
return response

@staticmethod
def delete_notebook_by_path(notebook_path: str = None):
Expand Down
3 changes: 2 additions & 1 deletion server/tests/services/test_notebook_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def test_get_all_notebooks(self):

def test_create_and_get_notebook(self):
with self.app.app_context():
Notebook.create_notebook_with_init_cells(notebook_name='Notebook.ipynb', notebook_path='')
create_response = Notebook.create_notebook_with_init_cells(notebook_name='Notebook.ipynb', notebook_path='')
print(create_response)

notebook = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[0]
status_code = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')[1]
Expand Down

0 comments on commit b4d3187

Please sign in to comment.