diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-23 11:01:25 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-23 11:01:25 -0700 |
commit | 7aab8b4ae4f5ab1710a985551c4105d608f5b852 (patch) | |
tree | fc0e9096c155374259b88f3d3404083f992e8836 /tests/hazmat/primitives/twofactor | |
parent | a05af52d1f0fba90030b62185d38523119d68b42 (diff) | |
download | cryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.tar.gz cryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.tar.bz2 cryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.zip |
Change how we represented that a test requires a backend.
This way is more extensible and requires less maintaince
Diffstat (limited to 'tests/hazmat/primitives/twofactor')
-rw-r--r-- | tests/hazmat/primitives/twofactor/test_hotp.py | 3 | ||||
-rw-r--r-- | tests/hazmat/primitives/twofactor/test_totp.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py index 803f96f3..92078e61 100644 --- a/tests/hazmat/primitives/twofactor/test_hotp.py +++ b/tests/hazmat/primitives/twofactor/test_hotp.py @@ -18,6 +18,7 @@ import os import pytest from cryptography.exceptions import InvalidToken, _Reasons +from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.hashes import MD5, SHA1 from cryptography.hazmat.primitives.twofactor.hotp import HOTP @@ -34,7 +35,7 @@ vectors = load_vectors_from_file( only_if=lambda backend: backend.hmac_supported(hashes.SHA1()), skip_message="Does not support HMAC-SHA1." ) -@pytest.mark.hmac +@pytest.mark.requires_backend_interface(interface=HMACBackend) class TestHOTP(object): def test_invalid_key_length(self, backend): secret = os.urandom(10) diff --git a/tests/hazmat/primitives/twofactor/test_totp.py b/tests/hazmat/primitives/twofactor/test_totp.py index 518d3ce8..6ad70ae1 100644 --- a/tests/hazmat/primitives/twofactor/test_totp.py +++ b/tests/hazmat/primitives/twofactor/test_totp.py @@ -16,6 +16,7 @@ from __future__ import absolute_import, division, print_function import pytest from cryptography.exceptions import InvalidToken, _Reasons +from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.twofactor.totp import TOTP @@ -27,7 +28,7 @@ vectors = load_vectors_from_file( "twofactor/rfc-6238.txt", load_nist_vectors) -@pytest.mark.hmac +@pytest.mark.requires_backend_interface(interface=HMACBackend) class TestTOTP(object): @pytest.mark.supported( only_if=lambda backend: backend.hmac_supported(hashes.SHA1()), |