diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-03-26 20:26:49 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-03-27 12:53:55 +0000 |
commit | 4c1401a3745af97fcd398ff5b7f0dcb94f5292a0 (patch) | |
tree | 5e9a953a04398bea99b95e07044eb917c28f56b3 /tests/hazmat/primitives/test_hmac.py | |
parent | f33ccfcc8e611359a65235d72423fc9c62b438da (diff) | |
download | cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.gz cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.bz2 cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.zip |
Update tests and raise sites
Diffstat (limited to 'tests/hazmat/primitives/test_hmac.py')
-rw-r--r-- | tests/hazmat/primitives/test_hmac.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py index cdf8909d..77dfb6be 100644 --- a/tests/hazmat/primitives/test_hmac.py +++ b/tests/hazmat/primitives/test_hmac.py @@ -21,12 +21,13 @@ import six from cryptography import utils from cryptography.exceptions import ( - AlreadyFinalized, InvalidSignature, UnsupportedAlgorithm + AlreadyFinalized, InvalidSignature, _Reasons ) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import hashes, hmac, interfaces from .utils import generate_base_hmac_test +from ...utils import raises_unsupported_algorithm @utils.register_interface(interfaces.HashAlgorithm) @@ -106,12 +107,12 @@ class TestHMAC(object): h.verify(six.u('')) def test_unsupported_hash(self, backend): - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): hmac.HMAC(b"key", UnsupportedDummyHash(), backend) def test_invalid_backend(): pretend_backend = object() - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.BACKEND_MISSING_INTERFACE): hmac.HMAC(b"key", hashes.SHA1(), pretend_backend) |