mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-02 07:13:02 +00:00
test(prometheus): cover a failed request with no carried org
This commit is contained in:
parent
0ce16cd68d
commit
3bfbd6a002
1 changed files with 14 additions and 0 deletions
|
|
@ -448,6 +448,20 @@ async def test_failed_request_without_the_auth_object_still_reads_the_committed_
|
|||
prometheus_logger.litellm_remaining_org_budget_metric.labels().set.assert_called_once_with(pytest.approx(435.0))
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_failed_request_without_a_carried_org_reads_no_committed_org_spend(
|
||||
prometheus_logger, getters, spend_counter_cache
|
||||
):
|
||||
_stub_gauges(prometheus_logger)
|
||||
_store_committed(spend_counter_cache, key=3.0, team=30.0, user=8.0, org=65.0)
|
||||
token = _token_committed_at_auth().model_copy(update={"org_budget_snapshot": None})
|
||||
metadata = {key: value for key, value in _request_metadata(token).items() if key != "user_api_key_auth"}
|
||||
|
||||
await prometheus_logger.async_log_failure_event(_failed_request(metadata), None, KEY_RESET_AT, KEY_RESET_AT)
|
||||
|
||||
prometheus_logger.litellm_remaining_org_budget_metric.labels().set.assert_called_once_with(pytest.approx(460.0))
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ordinary_metadata_keys_named_like_snapshot_fields_change_no_gauge(prometheus_logger, getters):
|
||||
_stub_gauges(prometheus_logger)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue