mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
test(rate-limits): add direct litellm_metadata lookup coverage
The new _stash_value_in_internal_metadata helper routes stash writes to the proxy-internal metadata bucket, which can be litellm_metadata on Responses routes. The lookup logic was updated to read from both channels, but the test only verified the legacy metadata path. Add explicit assertion testing lookup when values live in litellm_params["litellm_metadata"] to close the coverage gap Greptile flagged. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
68de15b01d
commit
29ef0504d7
1 changed files with 7 additions and 0 deletions
|
|
@ -3247,6 +3247,13 @@ async def test_pre_call_hook_does_not_touch_provider_metadata_on_litellm_metadat
|
|||
key=key,
|
||||
) == litellm_metadata.get(key)
|
||||
|
||||
for key in _LITELLM_STASH_KEYS:
|
||||
assert handler._lookup_stashed_value(
|
||||
kwargs={"litellm_params": {"litellm_metadata": litellm_metadata}},
|
||||
standard_logging_metadata=None,
|
||||
key=key,
|
||||
) == litellm_metadata.get(key)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_pre_call_hook_rejects_caller_supplied_stash_values():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue