From 19d4ed6f747248e4ff8cd1c524a7431871fd55f3 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Mon, 22 Mar 2021 09:39:46 +0100 Subject: git hook to update the lesana cache when files are changed by git. --- tests/test_collection.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3