diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-27 21:24:08 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-27 21:24:08 +0200 |
commit | 3f03960384881dfb41050599f9cb224f3a134a9e (patch) | |
tree | 817c55217107a53c08d3a7635cf8085545e7bb0c /tests/test_recursiveloader.py | |
parent | 948ed8eff9c98df8b11c292486f42308da179f64 (diff) | |
download | gemato-3f03960384881dfb41050599f9cb224f3a134a9e.tar.gz |
recursiveloader: Support saving Manifests
Diffstat (limited to 'tests/test_recursiveloader.py')
-rw-r--r-- | tests/test_recursiveloader.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py index 29bfb0f..3debeaa 100644 --- a/tests/test_recursiveloader.py +++ b/tests/test_recursiveloader.py @@ -284,6 +284,17 @@ DATA test 0 MD5 d41d8cd98f00b204e9800998ecf8427e os.path.join(self.dir, 'other')]), 1) + def test_save_manifest(self): + """ + Test if saving the (unmodified) Manifest works. + """ + m = gemato.recursiveloader.ManifestRecursiveLoader( + os.path.join(self.dir, 'Manifest')) + m.save_manifest('Manifest') + with io.open(os.path.join(self.dir, 'Manifest'), + 'r', encoding='utf8') as f: + self.assertEqual(f.read(), self.FILES['Manifest'].lstrip()) + class MultipleManifestTest(TempDirTestCase): DIRS = ['sub'] @@ -1045,6 +1056,14 @@ DATA test 0 MD5 d41d8cd98f00b204e9800998ecf8427e gemato.cli.main(['gemato', 'verify', self.dir]), 0) + def test_save_manifest(self): + m = gemato.recursiveloader.ManifestRecursiveLoader( + os.path.join(self.dir, 'Manifest.gz')) + m.save_manifest('Manifest.gz') + with gemato.compression.open_potentially_compressed_path( + os.path.join(self.dir, 'Manifest.gz'), 'rb') as f: + self.assertEqual(f.read(), self.MANIFEST.lstrip()) + class CompressedSubManifestTest(TempDirTestCase): """ |