diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-02-02 08:15:01 -0800 | 
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-02-02 08:15:01 -0800 | 
| commit | 2f54b2ba8953a309d35516d45634aeaa3ae03e14 (patch) | |
| tree | 1a9f5d1feedfcc3b3fb2ffd15c92b8534f5241a2 /tests | |
| parent | b84b215af8e7669d50b7b63fb37e6854ba6f99db (diff) | |
| parent | 30ff19b11a5586679549fbff8bddc0c03d4c590f (diff) | |
| download | cryptography-2f54b2ba8953a309d35516d45634aeaa3ae03e14.tar.gz cryptography-2f54b2ba8953a309d35516d45634aeaa3ae03e14.tar.bz2 cryptography-2f54b2ba8953a309d35516d45634aeaa3ae03e14.zip | |
Merge pull request #545 from public/error-strings
More detailed error message for InternalError
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hazmat/backends/test_openssl.py | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index b0a58c41..1e35322a 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -116,6 +116,23 @@ class TestOpenSSL(object):          assert backend._lib.ERR_peek_error() == 0 +    def test_openssl_error_string(self): +        backend._lib.ERR_put_error( +            backend._lib.ERR_LIB_EVP, +            backend._lib.EVP_F_EVP_DECRYPTFINAL_EX, +            0, +            b"test_openssl.py", +            -1 +        ) + +        with pytest.raises(InternalError) as exc: +            backend._handle_error(None) + +        assert ( +            "digital envelope routines:" +            "EVP_DecryptFinal_ex:digital envelope routines" in str(exc) +        ) +      def test_ssl_ciphers_registered(self):          meth = backend._lib.TLSv1_method()          ctx = backend._lib.SSL_CTX_new(meth) | 
