Show More
@@ -56,6 +56,20 b' class TestFileNotebookManager(TestCase):' | |||||
56 | fs_path = os.path.join(fm.notebook_dir, 'test.ipynb') |
|
56 | fs_path = os.path.join(fm.notebook_dir, 'test.ipynb') | |
57 | self.assertEqual(path, fs_path) |
|
57 | self.assertEqual(path, fs_path) | |
58 |
|
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 | ||||
|
72 | ||||
59 | class TestNotebookManager(TestCase): |
|
73 | class TestNotebookManager(TestCase): | |
60 |
|
74 | |||
61 | def setUp(self): |
|
75 | def setUp(self): |
General Comments 0
You need to be logged in to leave comments.
Login now