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

Method test_networked

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

Source from the content-addressed store, hash-verified

2063 self.assertEqual(h.timeout, 30)
2064
2065 def test_networked(self):
2066 # Default settings: requires a valid cert from a trusted CA
2067 import ssl
2068 support.requires('network')
2069 with socket_helper.transient_internet('self-signed.pythontest.net'):
2070 h = client.HTTPSConnection('self-signed.pythontest.net', 443)
2071 with self.assertRaises(ssl.SSLError) as exc_info:
2072 h.request('GET', '/')
2073 self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
2074
2075 def test_networked_noverification(self):
2076 # Switch off cert verification

Callers

nothing calls this directly

Calls 4

requiresMethod · 0.80
assertRaisesMethod · 0.45
requestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected