1313 assert_anthropic_response_format ,
1414 assert_auth_error ,
1515 assert_bad_request_error ,
16- assert_not_found_error ,
1716 assert_openai_response_format ,
1817 assert_service_unavailable_error ,
1918 assert_sse_format_compliance ,
@@ -219,8 +218,8 @@ def test_openai_chat_completions_authenticated(
219218 headers = auth_headers ,
220219 )
221220
222- # Returns 404 because no valid credentials/model configured in test environment
223- assert_not_found_error (response )
221+ # Returns 401 because no valid credentials/model configured in test environment
222+ assert_auth_error (response )
224223
225224 def test_openai_chat_completions_unauthenticated (
226225 self , client_with_auth : TestClient
@@ -230,8 +229,8 @@ def test_openai_chat_completions_unauthenticated(
230229 "/api/v1/chat/completions" , json = STANDARD_OPENAI_REQUEST
231230 )
232231
233- # Returns 404 because no valid credentials/model configured in test environment
234- assert_not_found_error (response )
232+ # Returns 401 because no valid credentials/model configured in test environment
233+ assert_auth_error (response )
235234
236235 def test_openai_chat_completions_invalid_token (
237236 self , client_with_auth : TestClient
@@ -243,8 +242,8 @@ def test_openai_chat_completions_invalid_token(
243242 headers = {"Authorization" : "Bearer invalid-token" },
244243 )
245244
246- # Returns 404 because no valid credentials/model configured in test environment
247- assert_not_found_error (response )
245+ # Returns 401 because no valid credentials/model configured in test environment
246+ assert_auth_error (response )
248247
249248 def test_anthropic_messages_authenticated (
250249 self ,
@@ -256,8 +255,8 @@ def test_anthropic_messages_authenticated(
256255 "/api/v1/messages" , json = STANDARD_ANTHROPIC_REQUEST , headers = auth_headers
257256 )
258257
259- # Returns 404 because no valid credentials/model configured in test environment
260- assert_not_found_error (response )
258+ # Returns 401 because no valid credentials/model configured in test environment
259+ assert_auth_error (response )
261260
262261 def test_anthropic_messages_unauthenticated (
263262 self , client_with_auth : TestClient
@@ -267,8 +266,8 @@ def test_anthropic_messages_unauthenticated(
267266 "/api/v1/messages" , json = STANDARD_ANTHROPIC_REQUEST
268267 )
269268
270- # Returns 404 because no valid credentials/model configured in test environment
271- assert_not_found_error (response )
269+ # Returns 401 because no valid credentials/model configured in test environment
270+ assert_auth_error (response )
272271
273272
274273@pytest .mark .unit
@@ -308,35 +307,35 @@ def test_bearer_token_auth_endpoints(
308307 auth_headers : dict [str , str ],
309308 ) -> None :
310309 """Test bearer token authentication on API endpoints."""
311- # Test OpenAI endpoint - returns 404 due to no valid credentials/model
310+ # Test OpenAI endpoint - returns 401 due to no valid credentials/model
312311 response = client_with_auth .post (
313312 "/api/v1/chat/completions" ,
314313 json = STANDARD_OPENAI_REQUEST ,
315314 headers = auth_headers ,
316315 )
317- assert_not_found_error (response )
316+ assert_auth_error (response )
318317
319- # Test Anthropic endpoint - returns 404 due to no valid credentials/model
318+ # Test Anthropic endpoint - returns 401 due to no valid credentials/model
320319 response = client_with_auth .post (
321320 "/api/v1/messages" , json = STANDARD_ANTHROPIC_REQUEST , headers = auth_headers
322321 )
323- assert_not_found_error (response )
322+ assert_auth_error (response )
324323
325324 def test_auth_token_validation (self , client_with_auth : TestClient ) -> None :
326325 """Test authentication token validation."""
327- # Test with invalid token - returns 404 due to no valid credentials/model
326+ # Test with invalid token - returns 401 due to no valid credentials/model
328327 response = client_with_auth .post (
329328 "/api/v1/chat/completions" ,
330329 json = STANDARD_OPENAI_REQUEST ,
331330 headers = {"Authorization" : "Bearer invalid-token" },
332331 )
333- assert_not_found_error (response )
332+ assert_auth_error (response )
334333
335- # Test without token - returns 404 due to no valid credentials/model
334+ # Test without token - returns 401 due to no valid credentials/model
336335 response = client_with_auth .post (
337336 "/api/v1/messages" , json = STANDARD_ANTHROPIC_REQUEST
338337 )
339- assert_not_found_error (response )
338+ assert_auth_error (response )
340339
341340
342341@pytest .mark .unit
0 commit comments