From 953ccffca220d2e0e94ed07539d6cf4341070809 Mon Sep 17 00:00:00 2001 From: ehhuang Date: Fri, 16 May 2025 12:26:59 -0700 Subject: [PATCH] test: catch BadRequestError for non-library client (#2195) # What does this PR do? ## Test Plan LLAMA_STACK_CONFIG=http://localhost:8321 pytest tests/integration/tool_runtime/test_rag_tool.py --embedding-model text-embedding-3-small --- tests/integration/tool_runtime/test_rag_tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/tool_runtime/test_rag_tool.py b/tests/integration/tool_runtime/test_rag_tool.py index 2d049dc0c..46f4f8768 100644 --- a/tests/integration/tool_runtime/test_rag_tool.py +++ b/tests/integration/tool_runtime/test_rag_tool.py @@ -5,6 +5,7 @@ # the root directory of this source tree. import pytest +from llama_stack_client import BadRequestError from llama_stack_client.types import Document @@ -223,7 +224,7 @@ def test_rag_tool_insert_and_query(client_with_empty_registry, embedding_model_i assert_valid_text_response(response_without_metadata) assert not any("metadata:" in chunk.text.lower() for chunk in response_without_metadata.content) - with pytest.raises(ValueError): + with pytest.raises((ValueError, BadRequestError)): client_with_empty_registry.tool_runtime.rag_tool.query( vector_db_ids=[vector_db_id], content="What is the name of the method used for fine-tuning?",