diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-27 11:04:21 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-27 11:04:21 -0700 |
commit | 3d5d6471b10e5f46eb8b40a9a41eb16e657d25b8 (patch) | |
tree | 8285f420269fd636e63c9152143750922e48e869 /tests/hazmat/backends/test_commoncrypto.py | |
parent | 844c14a15884fb60871640576e30a61e6c4c2db1 (diff) | |
parent | 85a791f0fa061ec644f5bfca41ee6038eeef38eb (diff) | |
download | cryptography-3d5d6471b10e5f46eb8b40a9a41eb16e657d25b8.tar.gz cryptography-3d5d6471b10e5f46eb8b40a9a41eb16e657d25b8.tar.bz2 cryptography-3d5d6471b10e5f46eb8b40a9a41eb16e657d25b8.zip |
Merge pull request #849 from public/changeup-exceptions-2-electric-boogaloo
Use a single tagged exception instead of a hierarchy
Diffstat (limited to 'tests/hazmat/backends/test_commoncrypto.py')
-rw-r--r-- | tests/hazmat/backends/test_commoncrypto.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py index 72ed61c0..7c703f67 100644 --- a/tests/hazmat/backends/test_commoncrypto.py +++ b/tests/hazmat/backends/test_commoncrypto.py @@ -16,13 +16,15 @@ from __future__ import absolute_import, division, print_function import pytest from cryptography import utils -from cryptography.exceptions import InternalError, UnsupportedCipher +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 +65,5 @@ class TestCommonCrypto(object): cipher = Cipher( DummyCipher(), GCM(b"fake_iv_here"), backend=b, ) - with pytest.raises(UnsupportedCipher): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() |