summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-28 19:09:41 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-28 19:09:41 +0100
commit49f7e58778733dbb86dad145dd35f906fd5bafbb (patch)
treea32075d2bf6251b7ff969357b627e68bbf807051
parentc819b077bb9125db303651a383fb03e68c822084 (diff)
parent6464b84b3ed28b0e66e27f180903b334151cbc70 (diff)
downloadcpython-git-49f7e58778733dbb86dad145dd35f906fd5bafbb.tar.gz
Forward port new test for SSLSocket.connect_ex()
-rw-r--r--Lib/test/test_ssl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index b3b878daca..21843cf8f7 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -714,6 +714,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