From d2af0577d535a68f438e39273c79b3b77cdf9987 Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Thu, 17 Sep 2026 15:39:07 -0400 Subject: [PATCH] test(files): assert key_model_access_denied error type instead of message text main (15f2e25e8a) replaced the configurable model-access-denied message with a fixed client message, so match on the stable error type. --- .../proxy/openai_files_endpoint/test_files_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py index cf80be6f655..c48fc572e40 100644 --- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py +++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py @@ -5357,7 +5357,7 @@ def test_model_routed_file_ops_reject_key_without_model_grant( app.dependency_overrides.pop(ps.user_api_key_auth, None) assert response.status_code == 403, response.text - assert "not allowed to access model" in response.text + assert response.json()["error"]["type"] == "key_model_access_denied" upstream.assert_not_called()