Skip to content

Commit 331ffd2

Browse files
gavinbarronbaywet
authored andcommitted
fix broken tests
1 parent 5377bba commit 331ffd2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/msgraph_core/graph_client_factory.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class GraphClientFactory():
2222
"""
2323

2424
@staticmethod
25-
def create_with_default_middleware( # type: ignore
26-
# Breaking change to remove KiotaClientFactory as base class
25+
def create_with_default_middleware(
2726
api_version: APIVersion = APIVersion.v1,
2827
client: Optional[httpx.AsyncClient] = None,
2928
host: NationalClouds = NationalClouds.Global,
@@ -50,15 +49,16 @@ def create_with_default_middleware( # type: ignore
5049
"""
5150
if client is None:
5251
client = KiotaClientFactory.get_default_client()
53-
client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore
52+
client.base_url = GraphClientFactory._get_base_url(
53+
host, api_version)
54+
5455
middleware = KiotaClientFactory.get_default_middleware(options)
5556
telemetry_handler = GraphClientFactory._get_telemetry_handler(options)
5657
middleware.append(telemetry_handler)
5758
return GraphClientFactory._load_middleware_to_client(client, middleware)
5859

5960
@staticmethod
60-
def create_with_custom_middleware( # type: ignore
61-
# Breaking change to remove Kiota client factory as base class
61+
def create_with_custom_middleware(
6262
middleware: Optional[list[BaseMiddleware]],
6363
api_version: APIVersion = APIVersion.v1,
6464
client: Optional[httpx.AsyncClient] = None,
@@ -83,7 +83,9 @@ def create_with_custom_middleware( # type: ignore
8383
"""
8484
if client is None:
8585
client = KiotaClientFactory.get_default_client()
86-
client.base_url = GraphClientFactory._get_base_url(host, api_version) # type: ignore
86+
client.base_url = GraphClientFactory._get_base_url(
87+
host, api_version)
88+
8789
return GraphClientFactory._load_middleware_to_client(client, middleware)
8890

8991
@staticmethod
@@ -124,7 +126,7 @@ def _load_middleware_to_client(
124126
mounts[pattern
125127
] = GraphClientFactory._replace_transport_with_custom_graph_transport(
126128
transport, middleware
127-
)
129+
)
128130
client._mounts = dict(sorted(mounts.items()))
129131
return client
130132

0 commit comments

Comments
 (0)