fix: correct import path for LlamaStackAsLibraryClient in test

Fixed incorrect import in test_mcp_authentication.py:
- Changed: from llama_stack import LlamaStackAsLibraryClient
- To: from llama_stack.core.library_client import LlamaStackAsLibraryClient

This aligns with the correct import pattern used in other test files.
This commit is contained in:
Omar Abdelwahab 2025-11-07 14:49:27 -08:00
parent 735831206d
commit 0f0aa6a6c5

View file

@ -8,7 +8,7 @@ import os
import pytest import pytest
from llama_stack import LlamaStackAsLibraryClient from llama_stack.core.library_client import LlamaStackAsLibraryClient
from tests.common.mcp import make_mcp_server from tests.common.mcp import make_mcp_server
from .helpers import setup_mcp_tools from .helpers import setup_mcp_tools
@ -104,14 +104,18 @@ def test_mcp_authorization_error_when_header_provided(compat_client, text_model_
"type": "mcp", "type": "mcp",
"server_label": "header-auth-mcp", "server_label": "header-auth-mcp",
"server_url": "<FILLED_BY_TEST_RUNNER>", "server_url": "<FILLED_BY_TEST_RUNNER>",
"headers": {"Authorization": f"Bearer {test_token}"}, # Security risk - should be rejected "headers": {
"Authorization": f"Bearer {test_token}"
}, # Security risk - should be rejected
} }
], ],
mcp_server_info, mcp_server_info,
) )
# Create response - should raise ValueError for security reasons # Create response - should raise ValueError for security reasons
with pytest.raises(ValueError, match="Authorization header cannot be passed via 'headers'"): with pytest.raises(
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,
input="What is the boiling point of myawesomeliquid?", input="What is the boiling point of myawesomeliquid?",