Show More
@@ -92,6 +92,11 class FileNotebookManager(NotebookManager): | |||
|
92 | 92 | i = i+1 |
|
93 | 93 | return name |
|
94 | 94 | |
|
95 | def os_path_exists(self, path): | |
|
96 | """Check that the given file system path is valid on this machine.""" | |
|
97 | if os.path.exists(path) is False: | |
|
98 | raise web.HTTPError(404, "No file or directory found.") | |
|
99 | ||
|
95 | 100 | def notebook_exists(self, name, path='/'): |
|
96 | 101 | """Returns a True if the notebook exists. Else, returns False. |
|
97 | 102 |
@@ -31,8 +31,8 class APITest(NotebookTestBase): | |||
|
31 | 31 | #url, nb = self.mknb() |
|
32 | 32 | url = self.notebook_url() |
|
33 | 33 | nb = requests.post(url+'/') |
|
34 | print nb.text | |
|
35 | 34 | data = nb.json() |
|
35 | status = nb.status_code | |
|
36 | 36 | assert isinstance(data, dict) |
|
37 | 37 | self.assertIn('name', data) |
|
38 | 38 | self.assertIn('path', data) |
@@ -119,7 +119,7 class SessionHandler(IPythonHandler): | |||
|
119 | 119 | _session_id_regex = r"(?P<session_id>\w+-\w+-\w+-\w+-\w+)" |
|
120 | 120 | |
|
121 | 121 | default_handlers = [ |
|
122 | (r"api/sessions/%s" % _session_id_regex, SessionHandler), | |
|
123 | (r"api/sessions", SessionRootHandler) | |
|
122 | (r"/api/sessions/%s" % _session_id_regex, SessionHandler), | |
|
123 | (r"/api/sessions", SessionRootHandler) | |
|
124 | 124 | ] |
|
125 | 125 |
General Comments 0
You need to be logged in to leave comments.
Login now