summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2020-05-02 14:22:11 -0400
committerEli Collins <elic@assurancetechnologies.com>2020-05-02 14:22:11 -0400
commite1c53136ececf6068351d526907e751f9aebed39 (patch)
tree1b9067a366377d6af79752f1f558189131cce85d /passlib/tests
parent18aa5a99271908054b8fc65d79c91c8404d486af (diff)
downloadpasslib-e1c53136ececf6068351d526907e751f9aebed39.tar.gz
passlib.crypto.digests: added hardcoded fallback info for common hashes;
so stats can be gathered retreived even if hash isn't available (e.g. FIPS mode)
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_crypto_digest.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/passlib/tests/test_crypto_digest.py b/passlib/tests/test_crypto_digest.py
index f948e39..461d209 100644
--- a/passlib/tests/test_crypto_digest.py
+++ b/passlib/tests/test_crypto_digest.py
@@ -129,6 +129,7 @@ class HashInfoTest(TestCase):
self.assertRaisesRegex(UnknownHashError, "unknown hash: 'xxx256'", info.const)
self.assertEqual(info.name, "xxx256")
self.assertEqual(info.digest_size, None)
+ self.assertEqual(info.block_size, None)
# should cache stub records
info2 = lookup_hash("xxx256", required=False)
@@ -155,6 +156,10 @@ class HashInfoTest(TestCase):
self.assertRegex(info.error_text, pat)
self.assertRaisesRegex(UnknownHashError, pat, info.const)
+ # should use hardcoded fallback info
+ self.assertEqual(info.digest_size, 16)
+ self.assertEqual(info.block_size, 64)
+
def test_lookup_hash_metadata(self):
"""lookup_hash() -- metadata"""