Skip to content

Commit

Permalink
Drop private imports from test_proxies.py (#2850)
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 authored Sep 16, 2023
1 parent 88e8431 commit e4241c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/client/test_proxies.py
Original file line number Diff line number Diff line change
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 e4241c6

Please sign in to comment.