diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 22:27:00 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 22:27:00 -0600 |
commit | a33a5e3e17140f8877aafa9db55f69008d4f42d2 (patch) | |
tree | 6fddd7138ce717e543ee08c880a81670333a5b3f /tests | |
parent | ed8d864f5412defe18d54dbf3c027120d4baeebe (diff) | |
download | cryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.tar.gz cryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.tar.bz2 cryptography-a33a5e3e17140f8877aafa9db55f69008d4f42d2.zip |
add error handler
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/backends/test_commoncrypto.py | 12 |
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) |