diff options
author | David Reid <dreid@dreid.org> | 2013-10-31 15:22:49 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-10-31 15:22:49 -0700 |
commit | bb0d3f0f2d064f4674793f2e0d8e9a3f04ad3ef1 (patch) | |
tree | cc2bc8af3fee57794440b7a933a74b51fe3f3999 /tests/hazmat/primitives/utils.py | |
parent | c3d029f2de71f74efe8ab6caf6ea9604a83a0531 (diff) | |
download | cryptography-bb0d3f0f2d064f4674793f2e0d8e9a3f04ad3ef1.tar.gz cryptography-bb0d3f0f2d064f4674793f2e0d8e9a3f04ad3ef1.tar.bz2 cryptography-bb0d3f0f2d064f4674793f2e0d8e9a3f04ad3ef1.zip |
Enforce that Hash takes a HashAlgorithm instance.
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index f5629561..efc5fbf0 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -66,12 +66,12 @@ def generate_hash_test(param_loader, path, file_names, hash_cls, return test_hash -def hash_test(backend, hash_cls, params, only_if, skip_message): +def hash_test(backend, algorithm, params, only_if, skip_message): if only_if is not None and not only_if(backend): pytest.skip(skip_message) msg = params[0] md = params[1] - m = hashes.Hash(hash_cls, backend=backend) + m = hashes.Hash(algorithm, backend=backend) m.update(binascii.unhexlify(msg)) expected_md = md.replace(" ", "").lower().encode("ascii") assert m.finalize() == binascii.unhexlify(expected_md) |