aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-19 22:27:00 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-19 22:27:00 -0600
commita33a5e3e17140f8877aafa9db55f69008d4f42d2 (patch)
tree6fddd7138ce717e543ee08c880a81670333a5b3f /tests/hazmat/backends
parented8d864f5412defe18d54dbf3c027120d4baeebe (diff)
downloadcryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.tar.gz
cryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.tar.bz2
cryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.zip
add error handler
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index 1d768ec4..8b353237 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -29,3 +29,15 @@ class TestCommonCrypto(object):
from cryptography.hazmat.backends.commoncrypto.backend import backend
with pytest.raises(ValueError):
backend.register_cipher_adapter(AES, CBC, None)
+
+ def test_handle_response(self):
+ from cryptography.hazmat.backends.commoncrypto.backend import backend
+
+ with pytest.raises(ValueError):
+ backend._check_response(backend._lib.kCCAlignmentError)
+
+ with pytest.raises(SystemError):
+ backend._check_response(backend._lib.kCCMemoryFailure)
+
+ with pytest.raises(SystemError):
+ backend._check_response(backend._lib.kCCDecodeError)