Skip to content

Commit 4b20b7b

Browse files
committed
test: exercise auth_flow to achieve 100% test file coverage
1 parent cd3ec03 commit 4b20b7b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎tests/client/test_session_group.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ async def test_establish_session_streamable_http_passes_auth():
506506
def test_server_parameters_auth_model_config_and_serialization():
507507
"""Verify that auth works with Pydantic arbitrary types and is excluded on dump."""
508508
fake_auth = _FakeBearerAuth(token="secret-token-123")
509+
req = httpx2.Request("GET", "http://test.com")
510+
list(fake_auth.auth_flow(req))
511+
assert fake_auth.call_count == 1
512+
assert req.headers["Authorization"] == "Bearer secret-token-123"
513+
509514
sse_params = SseServerParameters(url="http://test.com/sse", auth=fake_auth)
510515
assert sse_params.auth is fake_auth
511516
dumped_sse = sse_params.model_dump()

0 commit comments

Comments
 (0)