diff options
-rw-r--r-- | tests/test_collection.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index 9abb3f7..45c1efc 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -141,6 +141,13 @@ class testCollectionCreation(unittest.TestCase): self.assertTrue(os.path.isdir(os.path.join(tmpdir, '.lesana'))) self.assertTrue(os.path.isfile(os.path.join(tmpdir, 'settings.yaml'))) self.assertTrue(os.path.isfile(os.path.join(tmpdir, '.gitignore'))) + # and then run it twice on the same directory, nothing should break + collection = lesana.Collection.init(tmpdir) + self.assertIsInstance(collection, lesana.Collection) + self.assertTrue(os.path.isdir(os.path.join(tmpdir, '.git'))) + self.assertTrue(os.path.isdir(os.path.join(tmpdir, '.lesana'))) + self.assertTrue(os.path.isfile(os.path.join(tmpdir, 'settings.yaml'))) + self.assertTrue(os.path.isfile(os.path.join(tmpdir, '.gitignore'))) shutil.rmtree(tmpdir) def do_nothing(*args, **kwargs): @@ -164,4 +171,11 @@ class testCollectionCreation(unittest.TestCase): self.assertTrue(os.path.isdir(os.path.join(tmpdir, '.lesana'))) self.assertTrue(os.path.isfile(os.path.join(tmpdir, 'settings.yaml'))) self.assertFalse(os.path.isfile(os.path.join(tmpdir, '.gitignore'))) + # and then run it twice on the same directory, nothing should break + collection = lesana.Collection.init(tmpdir, git_enabled=False) + self.assertIsInstance(collection, lesana.Collection) + self.assertFalse(os.path.isdir(os.path.join(tmpdir, '.git'))) + self.assertTrue(os.path.isdir(os.path.join(tmpdir, '.lesana'))) + self.assertTrue(os.path.isfile(os.path.join(tmpdir, 'settings.yaml'))) + self.assertFalse(os.path.isfile(os.path.join(tmpdir, '.gitignore'))) shutil.rmtree(tmpdir) |