summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-28 18:08:49 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-28 18:08:49 (GMT)
commit6464b84b3ed28b0e66e27f180903b334151cbc70 (patch)
tree4d4adebae6144f03574ff90c2b71186476c5b257 /Lib/test/test_ssl.py
parent00e284311565c2caeadd10faa75cbe261b71bdaf (diff)
parentddb87ab1b4944fe85f7f1a3c8de6af664085bfbb (diff)
downloadcpython-6464b84b3ed28b0e66e27f180903b334151cbc70.zip
cpython-6464b84b3ed28b0e66e27f180903b334151cbc70.tar.gz
cpython-6464b84b3ed28b0e66e27f180903b334151cbc70.tar.bz2
Forward port new test for SSLSocket.connect_ex()
Diffstat (limited to 'Lib/test/test_ssl.py')
-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 74abbd2..0a6af5e 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