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

Method test_get_ca_certs_capath

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

Source from the content-addressed store, hash-verified

2093 s.connect(self.server_addr)
2094
2095 def test_get_ca_certs_capath(self):
2096 # capath certs are loaded on request
2097 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2098 ctx.load_verify_locations(capath=CAPATH)
2099 self.assertEqual(ctx.get_ca_certs(), [])
2100 with ctx.wrap_socket(socket.socket(socket.AF_INET),
2101 server_hostname='localhost') as s:
2102 s.connect(self.server_addr)
2103 cert = s.getpeercert()
2104 self.assertTrue(cert)
2105 self.assertEqual(len(ctx.get_ca_certs()), 1)
2106
2107 def test_context_setget(self):
2108 # Check that the context of a connected socket can be replaced.

Callers

nothing calls this directly

Calls 9

wrap_socketMethod · 0.95
lenFunction · 0.85
socketMethod · 0.80
assertTrueMethod · 0.80
load_verify_locationsMethod · 0.45
assertEqualMethod · 0.45
get_ca_certsMethod · 0.45
connectMethod · 0.45
getpeercertMethod · 0.45

Tested by

no test coverage detected