Skip to content

Commit f7de852

Browse files
author
Andrew Omondi
committed
chore: fix failing tests
1 parent c5f4c15 commit f7de852

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_graph_client_factory.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def test_create_with_default_middleware_custom_client():
4141
def test_create_with_default_middleware_custom_client_with_proxy():
4242
"""Test creation of GraphClient using default middleware"""
4343
proxies = {
44-
"http://": "http://localhost:8030",
45-
"https://": "http://localhost:8031",
44+
"http://": httpx.HTTPTransport(proxy="http://localhost:8030"),
45+
"https://": httpx.HTTPTransport(proxy="http://localhost:8031"),
4646
}
4747
timeout = httpx.Timeout(20, connect=10)
48-
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, proxies=proxies)
48+
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, mounts=proxies)
4949
client = GraphClientFactory.create_with_default_middleware(client=custom_client)
5050

5151
assert isinstance(client, httpx.AsyncClient)
@@ -98,11 +98,11 @@ def test_create_with_custom_middleware_custom_client():
9898
def test_create_with_custom_middleware_custom_client_with_proxy():
9999
"""Test creation of HTTP Clients with custom middleware"""
100100
proxies = {
101-
"http://": "http://localhost:8030",
102-
"https://": "http://localhost:8031",
101+
"http://": httpx.HTTPTransport(proxy="http://localhost:8030"),
102+
"https://": httpx.HTTPTransport(proxy="http://localhost:8031"),
103103
}
104104
timeout = httpx.Timeout(20, connect=10)
105-
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, proxies=proxies)
105+
custom_client = httpx.AsyncClient(timeout=timeout, http2=True, mounts=proxies)
106106
middleware = [
107107
GraphTelemetryHandler(),
108108
]

0 commit comments

Comments
 (0)