From 6956d6dc83d0b872210bbfef3e69bb6ecad08fde Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sun, 22 Oct 2017 21:58:53 +0200 Subject: test_hash: Cover invalid sha3/blake2 variants for fallback code --- tests/test_hash.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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')), -- cgit v1.2.3