diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-12-28 18:07:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-12-28 18:07:43 (GMT) |
commit | ddb87ab1b4944fe85f7f1a3c8de6af664085bfbb (patch) | |
tree | d5fda7900a3dfcd1a8584c59c0b772e9dcf9940e | |
parent | 0b386d524765d875fd5f7b6150219e5e5cd69abf (diff) | |
parent | 40f12ab0c5c5adc4a8b4a03a57ffa94c87ecc2cb (diff) | |
download | cpython-ddb87ab1b4944fe85f7f1a3c8de6af664085bfbb.zip cpython-ddb87ab1b4944fe85f7f1a3c8de6af664085bfbb.tar.gz cpython-ddb87ab1b4944fe85f7f1a3c8de6af664085bfbb.tar.bz2 |
Forward port new test for SSLSocket.connect_ex()
-rw-r--r-- | Lib/test/test_ssl.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 2f0b3e6..4f254a9 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -558,6 +558,17 @@ class NetworkedTests(unittest.TestCase): finally: s.close() + def test_connect_ex_error(self): + with support.transient_internet("svn.python.org"): + s = ssl.wrap_socket(socket.socket(socket.AF_INET), + cert_reqs=ssl.CERT_REQUIRED, + ca_certs=SVN_PYTHON_ORG_ROOT_CERT) + try: + self.assertEqual(errno.ECONNREFUSED, + s.connect_ex(("svn.python.org", 444))) + finally: + s.close() + def test_connect_with_context(self): with support.transient_internet("svn.python.org"): # Same as test_connect, but with a separately created context |