From 608e30495a938fcff3aaf633e3337b531b4f0df9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 13:00:35 -0500 Subject: [PATCH] chore: updates proxies tests to use new interface Signed-off-by: Vincent Biret --- .../http/httpx/tests/test_kiota_client_factory.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/http/httpx/tests/test_kiota_client_factory.py b/packages/http/httpx/tests/test_kiota_client_factory.py index eec62d7..62273fb 100644 --- a/packages/http/httpx/tests/test_kiota_client_factory.py +++ b/packages/http/httpx/tests/test_kiota_client_factory.py @@ -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) @@ -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(), ]