MCPcopy Index your code
hub / github.com/python/cpython / test_networked_trusted_by_default_cert

Method test_networked_trusted_by_default_cert

Lib/test/test_httplib.py:2090–2100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2088
2089 @support.system_must_validate_cert
2090 def test_networked_trusted_by_default_cert(self):
2091 # Default settings: requires a valid cert from a trusted CA
2092 support.requires('network')
2093 with socket_helper.transient_internet('www.python.org'):
2094 h = client.HTTPSConnection('www.python.org', 443)
2095 h.request('GET', '/')
2096 resp = h.getresponse()
2097 content_type = resp.getheader('content-type')
2098 resp.close()
2099 h.close()
2100 self.assertIn('text/html', content_type)
2101
2102 def test_networked_good_cert(self):
2103 # We feed the server's cert as a validating cert

Callers

nothing calls this directly

Calls 6

requiresMethod · 0.80
getheaderMethod · 0.80
assertInMethod · 0.80
requestMethod · 0.45
getresponseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected