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

Method test_connect

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

Source from the content-addressed store, hash-verified

1852 self.server_addr = (HOST, server.port)
1853
1854 def test_connect(self):
1855 with test_wrap_socket(socket.socket(socket.AF_INET),
1856 cert_reqs=ssl.CERT_NONE) as s:
1857 s.connect(self.server_addr)
1858 self.assertEqual({}, s.getpeercert())
1859 self.assertFalse(s.server_side)
1860
1861 # this should succeed because we specify the root cert
1862 with test_wrap_socket(socket.socket(socket.AF_INET),
1863 cert_reqs=ssl.CERT_REQUIRED,
1864 ca_certs=SIGNING_CA) as s:
1865 s.connect(self.server_addr)
1866 self.assertTrue(s.getpeercert())
1867 self.assertFalse(s.server_side)
1868
1869 def test_connect_fail(self):
1870 # This should fail because we have no verification certs. Connection

Callers

nothing calls this directly

Calls 7

test_wrap_socketFunction · 0.85
socketMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
connectMethod · 0.45
assertEqualMethod · 0.45
getpeercertMethod · 0.45

Tested by

no test coverage detected