@@ -53,12 +53,36 @@ Feature: Query endpoint API tests
5353 """
5454 {"query": "Write a simple code for reversing string"}
5555 """
56- Then The status code of the response is 400
56+ Then The status code of the response is 401
5757 And The body of the response is the following
5858 """
5959 {"detail": "No Authorization header found"}
6060 """
6161
62+ Scenario : Check if LLM responds to sent question with error when not authenticated with invalid token
63+ Given The system is in default state
64+ And I set the Authorization header to Bearer invalid
65+ When I use "query" to ask question with authorization header
66+ """
67+ {"query": "Write a simple code for reversing string"}
68+ """
69+ Then The status code of the response is 401
70+ And The body of the response is the following
71+ """
72+ {"detail":"Invalid token: decode error"}
73+ """
74+
75+ Scenario : Check if LLM responds to sent question with error when model does not exist
76+ Given The system is in default state
77+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
78+ When I use "query" to ask question with authorization header
79+ """
80+ {"query": "Write a simple code for reversing string", "model": "does-not-exist", "provider": "does-not-exist"}
81+ """
82+ Then The status code of the response is 404
83+ And The body of the response contains Model does-not-exist from provider does-not-exist not found in available models
84+
85+
6286 Scenario : Check if LLM responds to sent question with error when attempting to access conversation
6387 Given The system is in default state
6488 And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
@@ -138,3 +162,14 @@ Scenario: Check if LLM responds for query request with error for missing query
138162 }
139163 """
140164 Then The status code of the response is 200
165+ Scenario : Check if LLM responds with an error when no models are configured
166+ Given The service is started locally
167+ And REST API service prefix is /v1
168+ Given The system is in default state
169+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
170+ When I use "query" to ask question with authorization header
171+ """
172+ {"query": "Write a simple code for reversing string"}
173+ """
174+ Then The status code of the response is 404
175+ And The body of the response contains No models available
0 commit comments