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 7cc0f72f..7c703f67 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -11,16 +11,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import, division, print_function
+
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, InternalError
+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):
@@ -61,5 +65,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()