Skip to content

Commit

Permalink
chore: updates proxies tests to use new interface
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Dec 4, 2024
1 parent aa0b014 commit 608e304
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/http/httpx/tests/test_kiota_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def test_create_with_default_middleware_custom_client_with_proxy():
"""Test creation of HTTP Client using default middleware while providing
a custom client"""
proxies = {
"http://": "http://localhost:8030",
"https://": "http://localhost:8031",
"http://": httpx.HTTPTransport(proxy="http://localhost:8030"),
"https://": httpx.HTTPTransport(proxy="http://localhost:8031"),
}
timeout = httpx.Timeout(20, connect=10)
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, proxies=proxies)
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, mounts=proxies)
client = KiotaClientFactory.create_with_default_middleware(custom_client)

assert isinstance(client, httpx.AsyncClient)
Expand Down Expand Up @@ -96,11 +96,11 @@ def test_create_with_custom_middleware_custom_client_with_proxy():
"""Test creation of HTTP Client using custom middleware while providing
a custom client"""
proxies = {
"http://": "http://localhost:8030",
"https://": "http://localhost:8031",
"http://": httpx.HTTPTransport(proxy="http://localhost:8030"),
"https://": httpx.HTTPTransport(proxy="http://localhost:8031"),
}
timeout = httpx.Timeout(20, connect=10)
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, proxies=proxies)
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, mounts=proxies)
middleware = [
RetryHandler(),
]
Expand Down

0 comments on commit 608e304

Please sign in to comment.