Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Drop private imports from test_proxies.py
Browse files Browse the repository at this point in the history
Relates-to: encode#2492
  • Loading branch information
YDX-2147483647 committed Sep 16, 2023
1 parent 88e8431 commit ad657ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/client/test_proxies.py
Expand Up @@ -2,7 +2,6 @@
import pytest

import httpx
from httpx._utils import URLPattern


def url_to_origin(url: str) -> httpcore.URL:
Expand Down Expand Up @@ -35,11 +34,12 @@ def url_to_origin(url: str) -> httpcore.URL:
)
def test_proxies_parameter(proxies, expected_proxies):
client = httpx.Client(proxies=proxies)
client_patterns = [p.pattern for p in client._mounts.keys()]
client_proxies = list(client._mounts.values())

for proxy_key, url in expected_proxies:
pattern = URLPattern(proxy_key)
assert pattern in client._mounts
proxy = client._mounts[pattern]
assert proxy_key in client_patterns
proxy = client_proxies[client_patterns.index(proxy_key)]
assert isinstance(proxy, httpx.HTTPTransport)
assert isinstance(proxy._pool, httpcore.HTTPProxy)
assert proxy._pool._proxy_url == url_to_origin(url)
Expand Down

0 comments on commit ad657ec

Please sign in to comment.