Skip to content

Commit e60e70a

Browse files
author
Jianke LIN
committed
test(auth): cover bearer auth helper branch
1 parent 3b172f4 commit e60e70a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/server/auth/test_get_access_token_streamable_http.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ async def _handle_list_tools(ctx: ServerRequestContext, params: PaginatedRequest
4444

4545

4646
class _MutableBearerAuth(httpx2.Auth):
47-
def __init__(self, token: str | None) -> None:
47+
def __init__(self, token: str) -> None:
4848
self.token = token
4949

5050
def auth_flow(self, request: httpx2.Request):
51-
if self.token is not None:
52-
request.headers["Authorization"] = f"Bearer {self.token}"
51+
request.headers["Authorization"] = f"Bearer {self.token}"
5352
yield request
5453

5554

0 commit comments

Comments
 (0)