diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-22 21:58:53 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-22 21:58:53 +0200 |
commit | 6956d6dc83d0b872210bbfef3e69bb6ecad08fde (patch) | |
tree | bb99880a87aa8361cbc4fc94016f420e99b7f2cb /tests | |
parent | e3c494a1ba35fd32addcf3d1629467e25fceede8 (diff) | |
download | gemato-6956d6dc83d0b872210bbfef3e69bb6ecad08fde.tar.gz |
test_hash: Cover invalid sha3/blake2 variants for fallback code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_hash.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_hash.py b/tests/test_hash.py index 6a134f0..8ed4617 100644 --- a/tests/test_hash.py +++ b/tests/test_hash.py @@ -26,6 +26,14 @@ class HashAPITest(unittest.TestCase): self.assertRaises(gemato.hash.UnsupportedHash, gemato.hash.get_hash_by_name, '_invalid_name_') + def test_get_invalid_pyblake2(self): + self.assertRaises(gemato.hash.UnsupportedHash, + gemato.hash.get_hash_by_name, 'blake2zzz') + + def test_get_invalid_pysha3(self): + self.assertRaises(gemato.hash.UnsupportedHash, + gemato.hash.get_hash_by_name, 'sha3_987') + def test_hash_file(self): f = io.BytesIO(TEST_STRING) self.assertDictEqual(gemato.hash.hash_file(f, ('md5', 'sha1', 'sha256')), |