diff options
author | David Reid <dreid@dreid.org> | 2013-10-30 15:21:12 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-10-30 15:21:12 -0700 |
commit | 71102d8a98b940d1d70fd47f7d87989c07650ee2 (patch) | |
tree | bb7f58a3519d00dcd180cfcbf8fd3e6bae71a288 /tests/hazmat/primitives | |
parent | d86fa6ca5346b263cf145e94ac72c12feadb7c0c (diff) | |
download | cryptography-71102d8a98b940d1d70fd47f7d87989c07650ee2.tar.gz cryptography-71102d8a98b940d1d70fd47f7d87989c07650ee2.tar.bz2 cryptography-71102d8a98b940d1d70fd47f7d87989c07650ee2.zip |
Fix python3 compatibility and pep8
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_hashes.py | 4 | ||||
-rw-r--r-- | tests/hazmat/primitives/utils.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py index c7a18b83..43a0f448 100644 --- a/tests/hazmat/primitives/test_hashes.py +++ b/tests/hazmat/primitives/test_hashes.py @@ -86,7 +86,7 @@ class TestSHA384(object): hashes.SHA384, digest_size=48, block_size=128, - only_if=lambda backend: backend.hashes.supported(hashes.SHA384), + only_if=lambda backend: backend.hashes.supported(hashes.SHA384), skip_message="Does not support SHA384", ) @@ -116,7 +116,7 @@ class TestWhirlpool(object): hashes.Whirlpool, digest_size=64, block_size=64, - only_if=lambda backend: backend.hashes.supported(hashes.Whirlpool), + only_if=lambda backend: backend.hashes.supported(hashes.Whirlpool), skip_message="Does not support Whirlpool", ) diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index c02d1926..9ae8d217 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -125,7 +125,7 @@ def long_string_hash_test(backend, algorithm, md, only_if, skip_message): pytest.skip(skip_message) m = hashes.Hash(algorithm, backend=backend) m.update(b"a" * 1000000) - assert m.finalize() == binascii.unhexlify(md.lower()) + assert m.finalize() == binascii.unhexlify(md.lower().encode('ascii')) def generate_hmac_test(param_loader, path, file_names, digestmod, |