@@ -38,8 +38,9 @@ def test_get_all_notebooks(self):
38
38
39
39
def test_create_and_get_notebook (self ):
40
40
with self .app .app_context ():
41
- create_response = Notebook .create_notebook_with_init_cells (notebook_name = 'Notebook.ipynb' , notebook_path = '' )
42
- self .assertEqual (create_response [1 ], 200 )
41
+ # Create with name but without path & get by path
42
+ create_response_0 = Notebook .create_notebook_with_init_cells (notebook_name = 'Notebook.ipynb' , notebook_path = '' )
43
+ self .assertEqual (create_response_0 [1 ], 200 )
43
44
44
45
get_response_0 = Notebook .get_notebook_by_path (notebook_path = 'work/Notebook.ipynb' )
45
46
notebook_0 = get_response_0 [0 ]
@@ -50,11 +51,28 @@ def test_create_and_get_notebook(self):
50
51
self .assertEqual (notebook_0 ['path' ], 'work/Notebook.ipynb' )
51
52
self .assertEqual (len (notebook_0 ['content' ]['cells' ]), 2 )
52
53
53
- get_response_1 = Notebook .get_notebook_by_path (notebook_path = 'work/Notebook666.ipynb' )
54
- notebook_1 = get_response_1 [0 ]
55
- status_code_1 = get_response_1 [1 ]
54
+ # Create without name / path & get by path
55
+ create_response_1 = Notebook .create_notebook_with_init_cells (notebook_name = '' , notebook_path = '' )
56
+ self .assertEqual (create_response_1 [1 ], 200 )
57
+ print (create_response_1 )
56
58
57
- self .assertEqual (status_code_1 , 404 )
59
+ # get_response_1 = Notebook.get_notebook_by_path(notebook_path='work/Notebook.ipynb')
60
+ # notebook_0 = get_response_0[0]
61
+ # status_code_0 = get_response_0[1]
58
62
59
- print (notebook_1 .json ())
63
+ # self.assertEqual(status_code_0, 200)
64
+ # self.assertEqual(notebook_0['name'], 'Notebook.ipynb')
65
+ # self.assertEqual(notebook_0['path'], 'work/Notebook.ipynb')
66
+ # self.assertEqual(len(notebook_0['content']['cells']), 2)
67
+
68
+ # Create with name / path & get by path
69
+
70
+ # Get non-exist path
71
+ get_response_3 = Notebook .get_notebook_by_path (notebook_path = 'work/Notebook666.ipynb' )
72
+ status_code_3 = get_response_3 [1 ]
73
+
74
+ self .assertEqual (status_code_3 , 404 )
75
+
76
+ def test_delete_notebook (self ):
77
+ pass
60
78
0 commit comments