diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-06 16:40:04 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-06 16:40:04 -0400 |
commit | 1c6155a9aa47399ef17f23a169bc1233cec1bec3 (patch) | |
tree | 3a51676fbd8fbe147f61088e3e64dad6a7654d6e /tests/hazmat/primitives/test_pbkdf2hmac.py | |
parent | 4a3741e0d3dbf962e3e55b973968f625e2a1f544 (diff) | |
parent | 53e7b24e1ff91de415d2f128b1463bea33b756a9 (diff) | |
download | cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.tar.gz cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.tar.bz2 cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.zip |
Merge pull request #2762 from alex/dedupe-doubles
Un-double the test doubles
Diffstat (limited to 'tests/hazmat/primitives/test_pbkdf2hmac.py')
-rw-r--r-- | tests/hazmat/primitives/test_pbkdf2hmac.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/hazmat/primitives/test_pbkdf2hmac.py b/tests/hazmat/primitives/test_pbkdf2hmac.py index 7fb6bbd6..d971ebd0 100644 --- a/tests/hazmat/primitives/test_pbkdf2hmac.py +++ b/tests/hazmat/primitives/test_pbkdf2hmac.py @@ -6,7 +6,6 @@ from __future__ import absolute_import, division, print_function import pytest -from cryptography import utils from cryptography.exceptions import ( AlreadyFinalized, InvalidKey, _Reasons ) @@ -14,16 +13,10 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC +from ...doubles import DummyHashAlgorithm from ...utils import raises_unsupported_algorithm -@utils.register_interface(hashes.HashAlgorithm) -class DummyHash(object): - name = "dummy-hash" - block_size = None - digest_size = None - - class TestPBKDF2HMAC(object): def test_already_finalized(self): kdf = PBKDF2HMAC(hashes.SHA1(), 20, b"salt", 10, default_backend()) @@ -43,7 +36,9 @@ class TestPBKDF2HMAC(object): def test_unsupported_algorithm(self): with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): - PBKDF2HMAC(DummyHash(), 20, b"salt", 10, default_backend()) + PBKDF2HMAC( + DummyHashAlgorithm(), 20, b"salt", 10, default_backend() + ) def test_invalid_key(self): kdf = PBKDF2HMAC(hashes.SHA1(), 20, b"salt", 10, default_backend()) |