Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add test for openssl_assert
  • Loading branch information
reaperhulk committed Sep 25, 2015
1 parent 0c27fe5 commit 7712edc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/hazmat/backends/test_openssl.py
Expand Up @@ -17,7 +17,7 @@
from cryptography.exceptions import InternalError, _Reasons
from cryptography.hazmat.backends.interfaces import RSABackend
from cryptography.hazmat.backends.openssl.backend import (
Backend, backend
Backend, UnhandledOpenSSLError, backend
)
from cryptography.hazmat.backends.openssl.ec import _sn_to_elliptic_curve
from cryptography.hazmat.primitives import hashes, serialization
Expand Down Expand Up @@ -122,6 +122,11 @@ def test_nonexistent_cipher(self, mode):
with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
cipher.encryptor()

def test_openssl_assert(self):
backend.openssl_assert(True)
with pytest.raises(UnhandledOpenSSLError):
backend.openssl_assert(False)

def test_consume_errors(self):
for i in range(10):
backend._lib.ERR_put_error(backend._lib.ERR_LIB_EVP, 0, 0,
Expand Down

0 comments on commit 7712edc

Please sign in to comment.