mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix: add oauth2_flow=client_credentials to MCPServer test helper
This commit is contained in:
parent
2a879ef6f3
commit
180e72d15d
1 changed files with 3 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ def _server(**overrides) -> MCPServer:
|
|||
client_id="cid",
|
||||
client_secret="csec",
|
||||
token_url="https://auth.example.com/token",
|
||||
oauth2_flow="client_credentials",
|
||||
)
|
||||
defaults.update(overrides)
|
||||
return MCPServer(**defaults)
|
||||
|
|
@ -103,6 +104,7 @@ async def test_falls_back_to_static_token():
|
|||
client_id=None,
|
||||
client_secret=None,
|
||||
token_url=None,
|
||||
oauth2_flow=None,
|
||||
authentication_token="static-tok-xyz",
|
||||
)
|
||||
result = await resolve_mcp_auth(server)
|
||||
|
|
@ -115,7 +117,7 @@ def test_needs_user_oauth_token_property():
|
|||
assert _server().needs_user_oauth_token is False
|
||||
|
||||
# OAuth2 without credentials → needs per-user token
|
||||
assert _server(client_id=None, client_secret=None, token_url=None).needs_user_oauth_token is True
|
||||
assert _server(client_id=None, client_secret=None, token_url=None, oauth2_flow=None).needs_user_oauth_token is True
|
||||
|
||||
# Non-OAuth2 → never needs user OAuth token
|
||||
assert _server(auth_type=MCPAuth.bearer_token).needs_user_oauth_token is False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue