summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-29 10:18:35 +0100
committerMichał Górny <mgorny@gentoo.org>2017-10-29 10:18:35 +0100
commit8f93184bfebac5a3ae3856d8fa6a86158ea0b825 (patch)
tree63f02cc55a6d7cf212ec3c557b25437025945ff0 /tests
parent8f78c62730a468baf4ff1e9328a89f57bbbfb246 (diff)
downloadgemato-8f93184bfebac5a3ae3856d8fa6a86158ea0b825.tar.gz
recursiveloader: Fix adding multiple files (relpath overwrite)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_recursiveloader.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py
index 5631458..e0067c9 100644
--- a/tests/test_recursiveloader.py
+++ b/tests/test_recursiveloader.py
@@ -1947,3 +1947,30 @@ MANIFEST a/Manifest 0 MD5 d41d8cd98f00b204e9800998ecf8427e
self.assertEqual(
gemato.cli.main(['gemato', 'verify', self.dir]),
0)
+
+
+class MultipleSubdirectoryFilesTest(TempDirTestCase):
+ """
+ Regression test for adding a directory with multiple stray files.
+ """
+
+ DIRS = ['sub']
+ FILES = {
+ 'Manifest': u'',
+ 'sub/file.a': u'',
+ 'sub/file.b': u'',
+ 'sub/file.c': u'',
+ }
+
+ def test_update_entries_for_directory(self):
+ m = gemato.recursiveloader.ManifestRecursiveLoader(
+ os.path.join(self.dir, 'Manifest'))
+ m.update_entries_for_directory('', hashes=['SHA256', 'SHA512'])
+ self.assertEqual(m.find_path_entry('sub/file.a').path,
+ 'sub/file.a')
+ self.assertEqual(m.find_path_entry('sub/file.b').path,
+ 'sub/file.b')
+ self.assertEqual(m.find_path_entry('sub/file.c').path,
+ 'sub/file.c')
+ m.save_manifests()
+ m.assert_directory_verifies()