Show More
@@ -55,6 +55,20 b' class TestFileNotebookManager(TestCase):' | |||
|
55 | 55 | path = fm._get_os_path('test.ipynb', '////') |
|
56 | 56 | fs_path = os.path.join(fm.notebook_dir, 'test.ipynb') |
|
57 | 57 | self.assertEqual(path, fs_path) |
|
58 | ||
|
59 | def test_checkpoint_subdir(self): | |
|
60 | subd = u'sub ∂ir' | |
|
61 | cp_name = 'test-cp.ipynb' | |
|
62 | with TemporaryDirectory() as td: | |
|
63 | nbdir = td | |
|
64 | os.mkdir(os.path.join(td, subd)) | |
|
65 | fm = FileNotebookManager(notebook_dir=nbdir) | |
|
66 | cp_dir = fm.get_checkpoint_path('cp', 'test.ipynb', '/') | |
|
67 | cp_subdir = fm.get_checkpoint_path('cp', 'test.ipynb', '/%s/' % subd) | |
|
68 | self.assertNotEqual(cp_dir, cp_subdir) | |
|
69 | self.assertEqual(cp_dir, os.path.join(nbdir, fm.checkpoint_dir, cp_name)) | |
|
70 | self.assertEqual(cp_subdir, os.path.join(nbdir, subd, fm.checkpoint_dir, cp_name)) | |
|
71 | ||
|
58 | 72 | |
|
59 | 73 | class TestNotebookManager(TestCase): |
|
60 | 74 |
General Comments 0
You need to be logged in to leave comments.
Login now