File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ Scenario: Check if LLM responds for query request with error for missing query
175175 {"query": "Say hello", "model": "{MODEL}", "provider":"unknown"}
176176 """
177177 Then The status code of the response is 404
178- And The body of the response contains Model with ID gpt-4o-mini does not exist
178+ And The body of the response contains Model with ID {MODEL} does not exist
179179
180180 @skip-in-library-mode
181181 Scenario : Check if LLM responds for query request with error for inability to connect to llama-stack
Original file line number Diff line number Diff line change @@ -165,11 +165,17 @@ def check_response_body_schema(context: Context) -> None:
165165
166166@then ("The body of the response contains {substring}" )
167167def check_response_body_contains (context : Context , substring : str ) -> None :
168- """Check that response body contains a substring."""
168+ """Check that response body contains a substring.
169+
170+ Supports {MODEL} and {PROVIDER} placeholders in the substring so
171+ assertions work with any configured provider (e.g. unknown-provider
172+ error message includes the actual model id).
173+ """
169174 assert context .response is not None , "Request needs to be performed first"
175+ expected = replace_placeholders (context , substring )
170176 assert (
171- substring in context .response .text
172- ), f"The response text '{ context .response .text } ' doesn't contain '{ substring } '"
177+ expected in context .response .text
178+ ), f"The response text '{ context .response .text } ' doesn't contain '{ expected } '"
173179
174180
175181@then ("The body of the response is the following" )
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ Feature: streaming_query endpoint API tests
133133 {"query": "Say hello", "model": "{MODEL}", "provider":"unknown"}
134134 """
135135 Then The status code of the response is 404
136- And The body of the response contains Model with ID gpt-4o-mini does not exist
136+ And The body of the response contains Model with ID {MODEL} does not exist
137137 And The token metrics should not have changed
138138
139139 Scenario : Check if LLM responds properly when XML and JSON attachments are sent
You can’t perform that action at this time.
0 commit comments