Show More
@@ -222,6 +222,9 b' class ContentsManager(LoggingConfigurable):' | |||
|
222 | 222 | |
|
223 | 223 | def delete(self, path): |
|
224 | 224 | """Delete a file/directory and any associated checkpoints.""" |
|
225 | path = path.strip('/') | |
|
226 | if not path: | |
|
227 | raise HTTPError(400, "Can't delete root") | |
|
225 | 228 | self.delete_file(path) |
|
226 | 229 | self.checkpoints.delete_all_checkpoints(path) |
|
227 | 230 |
@@ -433,6 +433,12 b' class TestContentsManager(TestCase):' | |||
|
433 | 433 | # Check that a 'get' on the deleted notebook raises and error |
|
434 | 434 | self.assertRaises(HTTPError, cm.get, path) |
|
435 | 435 | |
|
436 | def test_delete_root(self): | |
|
437 | cm = self.contents_manager | |
|
438 | with self.assertRaises(HTTPError) as err: | |
|
439 | cm.delete('') | |
|
440 | self.assertEqual(err.exception.status_code, 400) | |
|
441 | ||
|
436 | 442 | def test_copy(self): |
|
437 | 443 | cm = self.contents_manager |
|
438 | 444 | parent = u'å b' |
General Comments 0
You need to be logged in to leave comments.
Login now