diff options
author | Donald Stufft <donald@stufft.io> | 2015-08-04 09:05:53 -0400 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2015-08-04 09:05:53 -0400 |
commit | eca59b7064be4c2e0b7f8255431060e271a7f67d (patch) | |
tree | c2ccd6c0a8508432b05f1a314f15f85fde249180 /tests/hazmat/bindings | |
parent | 2d135b759139ef470b753a4c92ec0aa93f6cdff4 (diff) | |
parent | a30f8b29973761452acff6488007774895595983 (diff) | |
download | cryptography-eca59b7064be4c2e0b7f8255431060e271a7f67d.tar.gz cryptography-eca59b7064be4c2e0b7f8255431060e271a7f67d.tar.bz2 cryptography-eca59b7064be4c2e0b7f8255431060e271a7f67d.zip |
Merge pull request #2180 from reaperhulk/easy-conditional-fix
create a ConditionalLibrary and remove unsupported items
Diffstat (limited to 'tests/hazmat/bindings')
-rw-r--r-- | tests/hazmat/bindings/test_openssl.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py index 75a8e3f1..20171fa7 100644 --- a/tests/hazmat/bindings/test_openssl.py +++ b/tests/hazmat/bindings/test_openssl.py @@ -131,3 +131,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 |