diff options
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r-- | tests/hazmat/primitives/test_block.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py index f758ffaa..acfd947c 100644 --- a/tests/hazmat/primitives/test_block.py +++ b/tests/hazmat/primitives/test_block.py @@ -19,7 +19,7 @@ import pytest from cryptography import utils from cryptography.exceptions import ( - UnsupportedAlgorithm, AlreadyFinalized, + AlreadyFinalized, _Reasons ) from cryptography.hazmat.primitives import interfaces from cryptography.hazmat.primitives.ciphers import ( @@ -29,6 +29,7 @@ from cryptography.hazmat.primitives.ciphers import ( from .utils import ( generate_aead_exception_test, generate_aead_tag_exception_test ) +from ...utils import raises_unsupported_algorithm @utils.register_interface(interfaces.Mode) @@ -116,10 +117,10 @@ class TestCipherContext(object): cipher = Cipher( DummyCipher(), mode, backend ) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.decryptor() def test_incorrectly_padded(self, backend): @@ -157,6 +158,7 @@ class TestAEADCipherContext(object): ) +@pytest.mark.cipher class TestModeValidation(object): def test_cbc(self, backend): with pytest.raises(ValueError): |