diff options
Diffstat (limited to 'tests/hazmat/primitives/test_hmac.py')
-rw-r--r-- | tests/hazmat/primitives/test_hmac.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py index 0e2fe688a..7ea931aca 100644 --- a/tests/hazmat/primitives/test_hmac.py +++ b/tests/hazmat/primitives/test_hmac.py @@ -9,7 +9,9 @@ import binascii import pytest from cryptography.exceptions import ( - AlreadyFinalized, InvalidSignature, _Reasons + AlreadyFinalized, + InvalidSignature, + _Reasons, ) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import hashes, hmac @@ -55,27 +57,27 @@ class TestHMAC(object): h.finalize() def test_verify(self, backend): - h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) + h = hmac.HMAC(b"", hashes.SHA1(), backend=backend) digest = h.finalize() - h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) + h = hmac.HMAC(b"", hashes.SHA1(), backend=backend) h.verify(digest) with pytest.raises(AlreadyFinalized): - h.verify(b'') + h.verify(b"") def test_invalid_verify(self, backend): - h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) + h = hmac.HMAC(b"", hashes.SHA1(), backend=backend) with pytest.raises(InvalidSignature): - h.verify(b'') + h.verify(b"") with pytest.raises(AlreadyFinalized): - h.verify(b'') + h.verify(b"") def test_verify_reject_unicode(self, backend): - h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) + h = hmac.HMAC(b"", hashes.SHA1(), backend=backend) with pytest.raises(TypeError): - h.verify(u'') + h.verify(u"") def test_unsupported_hash(self, backend): with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): |