diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-29 13:53:27 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-29 13:53:27 +0100 |
commit | 4c823bb0321c03ff18e694eec18204fa18b6264f (patch) | |
tree | e7511ea6811044befb5780eada9b91eebdfce0da /tests/test_recursiveloader.py | |
parent | 566eff1c70f54d5020d860ff449edc605aa828e3 (diff) | |
download | gemato-4c823bb0321c03ff18e694eec18204fa18b6264f.tar.gz |
cli: Support create action
Diffstat (limited to 'tests/test_recursiveloader.py')
-rw-r--r-- | tests/test_recursiveloader.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py index fb4b67d..e257a10 100644 --- a/tests/test_recursiveloader.py +++ b/tests/test_recursiveloader.py @@ -2178,6 +2178,22 @@ class CreateNewManifestTest(TempDirTestCase): m2.load(f) self.assertEqual(len(m2.entries), 2) + def test_cli(self): + self.assertEqual( + gemato.cli.main(['gemato', 'create', '--hashes=SHA256 SHA512', + self.path]), + 0) + + m2 = gemato.manifest.ManifestFile() + with io.open(self.path, 'r', encoding='utf8') as f: + m2.load(f) + self.assertEqual(len(m2.entries), 2) + + self.assertEqual( + gemato.cli.main(['gemato', 'verify', + self.dir]), + 0) + class CreateNewCompressedManifestTest(TempDirTestCase): DIRS = ['sub'] @@ -2228,3 +2244,20 @@ class CreateNewCompressedManifestTest(TempDirTestCase): self.path, 'r', encoding='utf8') as f: m2.load(f) self.assertEqual(len(m2.entries), 2) + + def test_cli(self): + self.assertEqual( + gemato.cli.main(['gemato', 'create', '--hashes=SHA256 SHA512', + self.path]), + 0) + + m2 = gemato.manifest.ManifestFile() + with gemato.compression.open_potentially_compressed_path( + self.path, 'r', encoding='utf8') as f: + m2.load(f) + self.assertEqual(len(m2.entries), 2) + + self.assertEqual( + gemato.cli.main(['gemato', 'verify', + self.dir]), + 0) |