aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_commoncrypto.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends/test_commoncrypto.py')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index dc6c8c5b..40a9f4a1 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -16,13 +16,17 @@ from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
-from cryptography.exceptions import InternalError, UnsupportedAlgorithm
+from cryptography.exceptions import (
+ InternalError, _Reasons
+)
from cryptography.hazmat.bindings.commoncrypto.binding import Binding
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.base import Cipher
from cryptography.hazmat.primitives.ciphers.modes import CBC, GCM
+from ...utils import raises_unsupported_algorithm
+
@utils.register_interface(interfaces.CipherAlgorithm)
class DummyCipher(object):
@@ -63,5 +67,5 @@ class TestCommonCrypto(object):
cipher = Cipher(
DummyCipher(), GCM(b"fake_iv_here"), backend=b,
)
- with pytest.raises(UnsupportedAlgorithm):
+ with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
cipher.encryptor()