summaryrefslogtreecommitdiff
path: root/tests/test_collection.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-03-22 09:39:46 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-03-22 09:39:46 +0100
commit19d4ed6f747248e4ff8cd1c524a7431871fd55f3 (patch)
tree15a563471077b8c97cce7627de24612645764c69 /tests/test_collection.py
parentdb7ca1a1ea4df4021e3ef4ea56b433b1e8eadce0 (diff)
git hook to update the lesana cache when files are changed by git.
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r--tests/test_collection.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index 2218169..2af4cfe 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -520,6 +520,24 @@ class testCollectionCreation(unittest.TestCase):
self.assertTrue(
os.path.isfile(os.path.join(self.tmpdir, '.gitignore'))
)
+ checkout_hook = os.path.join(
+ self.tmpdir,
+ '.git',
+ 'hooks',
+ 'post-checkout',
+ )
+ merge_hook = os.path.join(
+ self.tmpdir,
+ '.git',
+ 'hooks',
+ 'post-merge',
+ )
+ self.assertTrue(os.path.isfile(checkout_hook))
+ self.assertTrue(os.path.islink(merge_hook))
+ self.assertEqual(
+ os.path.abspath(checkout_hook),
+ os.path.abspath(os.readlink(merge_hook))
+ )
# and then run it twice on the same directory, nothing should break
collection = lesana.Collection.init(self.tmpdir)
self.assertIsInstance(collection, lesana.Collection)