MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_connect_fail

Method test_connect_fail

Lib/test/test_ssl.py:1869–1883  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1867 self.assertFalse(s.server_side)
1868
1869 def test_connect_fail(self):
1870 # This should fail because we have no verification certs. Connection
1871 # failure crashes ThreadedEchoServer, so run this in an independent
1872 # test method.
1873 s = test_wrap_socket(socket.socket(socket.AF_INET),
1874 cert_reqs=ssl.CERT_REQUIRED)
1875 self.addCleanup(s.close)
1876 # Allow for flexible libssl error messages.
1877 regex = re.compile(r"""(
1878 certificate verify failed # OpenSSL
1879 |
1880 CERTIFICATE_VERIFY_FAILED # AWS-LC
1881 )""", re.X)
1882 self.assertRaisesRegex(ssl.SSLError, regex,
1883 s.connect, self.server_addr)
1884
1885 def test_connect_ex(self):
1886 # Issue #11326: check connect_ex() implementation

Callers

nothing calls this directly

Calls 5

test_wrap_socketFunction · 0.85
socketMethod · 0.80
addCleanupMethod · 0.80
assertRaisesRegexMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected