mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
test: expect the new denial-context warning alongside the request-path denial warning
This commit is contained in:
parent
e333f4e4b0
commit
facbc8734c
1 changed files with 4 additions and 3 deletions
|
|
@ -547,8 +547,6 @@ def test_get_api_key_from_custom_header_different_casing():
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"user_role, auth_user_id, requested_user_id, expected_result",
|
||||
[
|
||||
|
|
@ -1869,7 +1867,10 @@ async def test_user_api_key_auth_websocket_logs_a_model_access_denial_as_one_war
|
|||
proxy_records: Final = [record for record in caplog.records if record.name == verbose_proxy_logger.name]
|
||||
assert [record.getMessage() for record in proxy_records if record.exc_info is not None] == []
|
||||
assert [record.getMessage() for record in proxy_records if record.levelno == logging.WARNING] == [
|
||||
"key not allowed to access model. This key can only access models=['gpt-5.4-mini']. Tried to access gpt-5.4"
|
||||
# Server-side denial context from can_key_call_model (key identity stays out of the
|
||||
# client-facing exception), followed by the request-path denial warning.
|
||||
"Model access denied: key_alias=None key_name=None user_id=None requested_model=gpt-5.4 allowed_models=['gpt-5.4-mini']",
|
||||
"key not allowed to access model. This key can only access models=['gpt-5.4-mini']. Tried to access gpt-5.4",
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue