()
| 14 | |
| 15 | |
| 16 | def test_socks_proxy(): |
| 17 | url = httpx.URL("http://www.example.com") |
| 18 | |
| 19 | for proxy in ("socks5://localhost/", "socks5h://localhost/"): |
| 20 | client = httpx.Client(proxy=proxy) |
| 21 | transport = client._transport_for_url(url) |
| 22 | assert isinstance(transport, httpx.HTTPTransport) |
| 23 | assert isinstance(transport._pool, httpcore.SOCKSProxy) |
| 24 | |
| 25 | async_client = httpx.AsyncClient(proxy=proxy) |
| 26 | async_transport = async_client._transport_for_url(url) |
| 27 | assert isinstance(async_transport, httpx.AsyncHTTPTransport) |
| 28 | assert isinstance(async_transport._pool, httpcore.AsyncSOCKSProxy) |
| 29 | |
| 30 | |
| 31 | PROXY_URL = "http://[::1]" |
nothing calls this directly
no test coverage detected