mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
test: update error message match for authorization validation
Updated test_mcp_authorization_error_when_header_provided to match the new validation error message from the Pydantic validator.
This commit is contained in:
parent
1c27c1bef6
commit
8ce30b71f4
1 changed files with 2 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ def test_mcp_authorization_different_token(compat_client, text_model_id):
|
||||||
"type": "mcp",
|
"type": "mcp",
|
||||||
"server_label": "auth2-mcp",
|
"server_label": "auth2-mcp",
|
||||||
"server_url": "<FILLED_BY_TEST_RUNNER>",
|
"server_url": "<FILLED_BY_TEST_RUNNER>",
|
||||||
"authorization": test_token, # Just the token, not "Bearer <token>"
|
"authorization": test_token,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
mcp_server_info,
|
mcp_server_info,
|
||||||
|
|
@ -112,7 +112,7 @@ def test_mcp_authorization_error_when_header_provided(compat_client, text_model_
|
||||||
|
|
||||||
# Create response - should raise ValueError for security reasons
|
# Create response - should raise ValueError for security reasons
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
ValueError, match="For security reasons, Authorization header cannot be passed via 'headers'"
|
ValueError, match="Authorization header cannot be passed via 'headers'"
|
||||||
):
|
):
|
||||||
compat_client.responses.create(
|
compat_client.responses.create(
|
||||||
model=text_model_id,
|
model=text_model_id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue