diff options
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r-- | tests/hazmat/primitives/test_block.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py index f2dab6cf..68d6c849 100644 --- a/tests/hazmat/primitives/test_block.py +++ b/tests/hazmat/primitives/test_block.py @@ -18,7 +18,9 @@ import binascii import pytest from cryptography import utils -from cryptography.exceptions import AlreadyFinalized, UnsupportedCipher +from cryptography.exceptions import ( + AlreadyFinalized, _Reasons +) from cryptography.hazmat.primitives import interfaces from cryptography.hazmat.primitives.ciphers import ( Cipher, algorithms, modes @@ -27,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) @@ -114,10 +117,10 @@ class TestCipherContext(object): cipher = Cipher( DummyCipher(), mode, backend ) - with pytest.raises(UnsupportedCipher): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() - with pytest.raises(UnsupportedCipher): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.decryptor() def test_incorrectly_padded(self, backend): |