MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_proxy_https_bad_response

Function test_proxy_https_bad_response

tests/test_proxy_functional.py:579–590  ·  view source on GitHub ↗
(proxy_test_server, get_request)

Source from the content-addressed store, hash-verified

577
578
579async def test_proxy_https_bad_response(proxy_test_server, get_request) -> None:
580 url = "https://secure.aiohttp.io/path"
581 proxy = await proxy_test_server()
582 proxy.return_value = dict(status=502, headers={"Proxy-Agent": "TestProxy"})
583
584 with pytest.raises(aiohttp.ClientHttpProxyError):
585 await get_request(url=url, proxy=proxy.url)
586
587 assert len(proxy.requests_list) == 1
588 assert proxy.request.method == "CONNECT"
589 # The following check fails on MacOS
590 # assert proxy.request.path == 'secure.aiohttp.io:443'
591
592
593@pytest.mark.xfail

Callers

nothing calls this directly

Calls 2

proxy_test_serverFunction · 0.85
get_requestFunction · 0.85

Tested by

no test coverage detected