aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_hmac.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-06 16:40:04 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-06 16:40:04 -0400
commit1c6155a9aa47399ef17f23a169bc1233cec1bec3 (patch)
tree3a51676fbd8fbe147f61088e3e64dad6a7654d6e /tests/hazmat/primitives/test_hmac.py
parent4a3741e0d3dbf962e3e55b973968f625e2a1f544 (diff)
parent53e7b24e1ff91de415d2f128b1463bea33b756a9 (diff)
downloadcryptography-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_hmac.py')
-rw-r--r--tests/hazmat/primitives/test_hmac.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py
index 83b18cbc..82082a2d 100644
--- a/tests/hazmat/primitives/test_hmac.py
+++ b/tests/hazmat/primitives/test_hmac.py
@@ -8,7 +8,6 @@ import pretend
import pytest
-from cryptography import utils
from cryptography.exceptions import (
AlreadyFinalized, InvalidSignature, _Reasons
)
@@ -17,16 +16,10 @@ from cryptography.hazmat.primitives import hashes, hmac
from .utils import generate_base_hmac_test
from ..backends.test_multibackend import DummyHMACBackend
+from ...doubles import DummyHashAlgorithm
from ...utils import raises_unsupported_algorithm
-@utils.register_interface(hashes.HashAlgorithm)
-class UnsupportedDummyHash(object):
- name = "unsupported-dummy-hash"
- block_size = None
- digest_size = None
-
-
@pytest.mark.supported(
only_if=lambda backend: backend.hmac_supported(hashes.MD5()),
skip_message="Does not support MD5",
@@ -95,7 +88,7 @@ class TestHMAC(object):
def test_unsupported_hash(self, backend):
with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH):
- hmac.HMAC(b"key", UnsupportedDummyHash(), backend)
+ hmac.HMAC(b"key", DummyHashAlgorithm(), backend)
def test_invalid_backend():