Commit b16a1bfb authored by Antoine Pitrou's avatar Antoine Pitrou

Forward port new test for SSLSocket.connect_ex()

parents d5e449a2 a36e7c86
File mode changed from 100755 to 100644
File mode changed from 100644 to 100755
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -558,6 +558,17 @@ class NetworkedTests(unittest.TestCase): ...@@ -558,6 +558,17 @@ class NetworkedTests(unittest.TestCase):
finally: finally:
s.close() 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): def test_connect_with_context(self):
with support.transient_internet("svn.python.org"): with support.transient_internet("svn.python.org"):
# Same as test_connect, but with a separately created context # Same as test_connect, but with a separately created context
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment