mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
test: assert the allowed self-edit path returns clean (test-quality TQ001)
Generated-by: termag
This commit is contained in:
parent
582f337aad
commit
bc14992545
1 changed files with 6 additions and 2 deletions
|
|
@ -5278,11 +5278,13 @@ def test_user_update_self_write_of_innocuous_field_allowed():
|
|||
)
|
||||
|
||||
data = UpdateUserRequest(user_id="self", user_alias="me")
|
||||
_reject_ceiling_self_update(
|
||||
no_raise = _reject_ceiling_self_update(
|
||||
sent_fields=set(data.fields_set()),
|
||||
non_default_values={"user_alias": "me"},
|
||||
user_api_key_dict=UserAPIKeyAuth(user_id="self", user_role=LitellmUserRoles.INTERNAL_USER),
|
||||
)
|
||||
# The observable on an allowed self-edit is that the guard raised nothing.
|
||||
assert no_raise is None
|
||||
|
||||
|
||||
def test_user_update_admin_self_write_unrestricted():
|
||||
|
|
@ -5293,11 +5295,13 @@ def test_user_update_admin_self_write_unrestricted():
|
|||
)
|
||||
|
||||
data = UpdateUserRequest(user_id="admin", rpm_limit=1000000, models=[])
|
||||
_reject_ceiling_self_update(
|
||||
no_raise = _reject_ceiling_self_update(
|
||||
sent_fields=set(data.fields_set()),
|
||||
non_default_values={"rpm_limit": 1000000, "models": []},
|
||||
user_api_key_dict=UserAPIKeyAuth(user_id="admin", user_role=LitellmUserRoles.PROXY_ADMIN),
|
||||
)
|
||||
# The observable on an admin self-edit is that the guard raised nothing.
|
||||
assert no_raise is None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue