aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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)