[pypy-commit] pypy default: add test that fails on win32, save_err is wrong on SSL_CTX_use_certificate_chain_file in rpython/rlib/ropenssl?

mattip noreply at buildbot.pypy.org
Mon Feb 16 07:24:28 CET 2015


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r75911:37183f083a3a
Date: 2015-02-16 08:25 +0200
http://bitbucket.org/pypy/pypy/changeset/37183f083a3a/

Log:	add test that fails on win32, save_err is wrong on
	SSL_CTX_use_certificate_chain_file in rpython/rlib/ropenssl?

diff --git a/pypy/module/_ssl/test/test_ssl.py b/pypy/module/_ssl/test/test_ssl.py
--- a/pypy/module/_ssl/test/test_ssl.py
+++ b/pypy/module/_ssl/test/test_ssl.py
@@ -307,12 +307,13 @@
             os.path.dirname(__file__), 'dh512.pem'))
 
     def test_load_cert_chain(self):
-        import _ssl
+        import _ssl, errno
         ctx = _ssl._SSLContext(_ssl.PROTOCOL_TLSv1)
         ctx.load_cert_chain(self.keycert)
         ctx.load_cert_chain(self.cert, self.key)
-        raises(IOError, ctx.load_cert_chain, "inexistent.pem")
-        raises(_ssl.SSLError, ctx.load_cert_chain, self.badcert)
+        exc = raises(IOError, ctx.load_cert_chain, "inexistent.pem")
+        assert exc.value.errno == errno.ENOENT
+        exc = raises(_ssl.SSLError, ctx.load_cert_chain, self.badcert)
         raises(_ssl.SSLError, ctx.load_cert_chain, self.emptycert)
         # Password protected key and cert
         raises(_ssl.SSLError, ctx.load_cert_chain, self.cert_protected,


More information about the pypy-commit mailing list