(proxy_test_server, get_request)
| 378 | |
| 379 | |
| 380 | async def test_proxy_http_auth(proxy_test_server, get_request) -> None: |
| 381 | url = "http://aiohttp.io/path" |
| 382 | proxy = await proxy_test_server() |
| 383 | |
| 384 | await get_request(url=url, proxy=proxy.url) |
| 385 | |
| 386 | assert "Authorization" not in proxy.request.headers |
| 387 | assert "Proxy-Authorization" not in proxy.request.headers |
| 388 | |
| 389 | auth = aiohttp.BasicAuth("user", "pass") |
| 390 | await get_request(url=url, auth=auth, proxy=proxy.url) |
| 391 | |
| 392 | assert "Authorization" in proxy.request.headers |
| 393 | assert "Proxy-Authorization" not in proxy.request.headers |
| 394 | |
| 395 | await get_request(url=url, proxy_auth=auth, proxy=proxy.url) |
| 396 | |
| 397 | assert "Authorization" not in proxy.request.headers |
| 398 | assert "Proxy-Authorization" in proxy.request.headers |
| 399 | |
| 400 | await get_request(url=url, auth=auth, proxy_auth=auth, proxy=proxy.url) |
| 401 | |
| 402 | assert "Authorization" in proxy.request.headers |
| 403 | assert "Proxy-Authorization" in proxy.request.headers |
| 404 | |
| 405 | |
| 406 | async def test_proxy_http_auth_utf8(proxy_test_server, get_request) -> None: |
nothing calls this directly
no test coverage detected