diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-29 14:43:11 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-29 14:43:11 +0100 |
commit | 442950a07eeec9fbee105241c1edf07d834f110c (patch) | |
tree | a7f1aa8339faa4e9fa7e02629f89d0e9c1497bf9 /tests/test_recursiveloader.py | |
parent | dd521bd834e448628a286d067c2d35c4bf38f786 (diff) | |
download | gemato-442950a07eeec9fbee105241c1edf07d834f110c.tar.gz |
recursiveloader: Support forcing Manifest update
Diffstat (limited to 'tests/test_recursiveloader.py')
-rw-r--r-- | tests/test_recursiveloader.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py index e257a10..1e9b186 100644 --- a/tests/test_recursiveloader.py +++ b/tests/test_recursiveloader.py @@ -348,6 +348,32 @@ DATA test 0 MD5 d41d8cd98f00b204e9800998ecf8427e 'r', encoding='utf8') as f: self.assertEqual(f.read(), self.FILES['Manifest'].lstrip()) + def test_save_manifests_unmodified(self): + m = gemato.recursiveloader.ManifestRecursiveLoader( + os.path.join(self.dir, 'Manifest')) + m.save_manifests() + with io.open(os.path.join(self.dir, 'Manifest'), + 'r', encoding='utf8') as f: + self.assertEqual(f.read(), self.FILES['Manifest']) + with io.open(os.path.join(self.dir, 'sub/Manifest'), + 'r', encoding='utf8') as f: + self.assertEqual(f.read(), self.FILES['sub/Manifest']) + with io.open(os.path.join(self.dir, 'other/Manifest'), + 'r', encoding='utf8') as f: + self.assertEqual(f.read(), self.FILES['other/Manifest']) + + def test_save_manifests_force(self): + m = gemato.recursiveloader.ManifestRecursiveLoader( + os.path.join(self.dir, 'Manifest')) + m.save_manifests(force=True) + # Manifest checksums change + with io.open(os.path.join(self.dir, 'Manifest'), + 'r', encoding='utf8') as f: + self.assertNotEqual(f.read(), self.FILES['Manifest']) + with io.open(os.path.join(self.dir, 'sub/Manifest'), + 'r', encoding='utf8') as f: + self.assertNotEqual(f.read(), self.FILES['sub/Manifest']) + def test_update_entry_for_path(self): m = gemato.recursiveloader.ManifestRecursiveLoader( os.path.join(self.dir, 'Manifest')) |