MCPcopy
hub / github.com/urllib3/urllib3 / test_verified

Method test_verified

test/with_dummyserver/test_https.py:234–249  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

232 assert type(e.value.reason) is SSLError
233
234 def test_verified(self) -> None:
235 with HTTPSConnectionPool(
236 self.host,
237 self.port,
238 cert_reqs="CERT_REQUIRED",
239 ca_certs=DEFAULT_CA,
240 ssl_minimum_version=self.tls_version(),
241 ) as https_pool:
242 with contextlib.closing(https_pool._new_conn()) as conn:
243 assert conn.__class__ == VerifiedHTTPSConnection
244
245 with warnings.catch_warnings(record=True) as w:
246 r = https_pool.request("GET", "/")
247 assert r.status == 200
248
249 assert [str(wm) for wm in w] == []
250
251 def test_verified_with_context(self) -> None:
252 ctx = util.ssl_.create_urllib3_context(

Callers

nothing calls this directly

Calls 4

tls_versionMethod · 0.95
HTTPSConnectionPoolClass · 0.90
_new_connMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected