mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
test(proxy): tighten get_spend_routes=false deny assertion
ruff-tests B017/PT011 rejected bare pytest.raises(Exception). Match the sibling global-spend deny tests (Exception + match + assert).
This commit is contained in:
parent
63274fb42b
commit
9d8d17ec1a
1 changed files with 2 additions and 2 deletions
|
|
@ -2191,7 +2191,7 @@ def test_get_spend_routes_false_permission_denies_internal_user(route):
|
|||
request = MagicMock(spec=Request)
|
||||
request.query_params = {}
|
||||
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(Exception, match="Only proxy admin can be used to generate, delete, update") as exc_info:
|
||||
RouteChecks.non_proxy_admin_allowed_routes_check(
|
||||
user_obj=user_obj,
|
||||
_user_role=LitellmUserRoles.INTERNAL_USER.value,
|
||||
|
|
@ -2200,7 +2200,7 @@ def test_get_spend_routes_false_permission_denies_internal_user(route):
|
|||
valid_token=valid_token,
|
||||
request_data={},
|
||||
)
|
||||
|
||||
assert "Only proxy admin" in str(exc_info.value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("route", ["/audit", "/audit/some-log-id"])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue