From 0f0aa6a6c574afedc46011b8c708613728850eb3 Mon Sep 17 00:00:00 2001 From: Omar Abdelwahab Date: Fri, 7 Nov 2025 14:49:27 -0800 Subject: [PATCH] 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. --- tests/integration/responses/test_mcp_authentication.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/responses/test_mcp_authentication.py b/tests/integration/responses/test_mcp_authentication.py index 3293814ff..61e7abe6f 100644 --- a/tests/integration/responses/test_mcp_authentication.py +++ b/tests/integration/responses/test_mcp_authentication.py @@ -8,7 +8,7 @@ import os import pytest -from llama_stack import LlamaStackAsLibraryClient +from llama_stack.core.library_client import LlamaStackAsLibraryClient from tests.common.mcp import make_mcp_server from .helpers import setup_mcp_tools @@ -104,14 +104,18 @@ def test_mcp_authorization_error_when_header_provided(compat_client, text_model_ "type": "mcp", "server_label": "header-auth-mcp", "server_url": "", - "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, ) # 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( model=text_model_id, input="What is the boiling point of myawesomeliquid?",