aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-01 12:35:25 +0100
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-01 13:50:20 +0100
commit369a9c61a8247211cf1e59d324f26f7d8846e483 (patch)
tree747e479338a8f28293a5b7f6920dc7a8579a2bf6 /tests
parent3f8cf63bf19f6b3ed666621d04511c485a7ef40a (diff)
downloadcryptography-369a9c61a8247211cf1e59d324f26f7d8846e483.tar.gz
cryptography-369a9c61a8247211cf1e59d324f26f7d8846e483.tar.bz2
cryptography-369a9c61a8247211cf1e59d324f26f7d8846e483.zip
add test for conditional removal
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/bindings/test_openssl.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py
index f3f2eaf4..c5f0a7d7 100644
--- a/tests/hazmat/bindings/test_openssl.py
+++ b/tests/hazmat/bindings/test_openssl.py
@@ -161,3 +161,21 @@ class TestOpenSSL(object):
expected_options = current_options | b.lib.SSL_OP_ALL
assert resp == expected_options
assert b.lib.SSL_get_mode(ssl) == expected_options
+
+ def test_conditional_removal(self):
+ b = Binding()
+ if b.lib.OPENSSL_VERSION_NUMBER >= 0x10000000:
+ assert b.lib.X509_V_ERR_DIFFERENT_CRL_SCOPE
+ assert b.lib.X509_V_ERR_CRL_PATH_VALIDATION_ERROR
+ else:
+ with pytest.raises(AttributeError):
+ b.lib.X509_V_ERR_DIFFERENT_CRL_SCOPE
+
+ with pytest.raises(AttributeError):
+ b.lib.X509_V_ERR_CRL_PATH_VALIDATION_ERROR
+
+ if b.lib.OPENSSL_VERSION_NUMBER >= 0x10001000:
+ assert b.lib.CMAC_Init
+ else:
+ with pytest.raises(AttributeError):
+ b.lib.CMAC_Init