summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 17:38:42 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 17:38:42 +0100
commit9a7168c0262da9a2b4a6338a5179ce644a84fb15 (patch)
tree01caeaad144f641b28ec6a37c5dddb758b635577
parent6daa9e9dfa6a4d7357fe6edc167ef1fe4459810f (diff)
additional tests on init
-rw-r--r--tests/test_collection.py14
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)