litellm/tests/unit/proxy/utils/helpers
Solomon Mithra 0e455ae7a9
fix(proxy): use budget reset window for projected spend alerts (#31942)
* fix(proxy): use budget reset window for projected spend alerts

* style(proxy): use PEP 585 tuple annotations in projection helpers

* fix(proxy): derive projection date from budget reset timezone

* fix(proxy): project spend in real time within the budget reset window

* fix(proxy): derive the projection window start from the reset schedule

30d and monthly keys reset on the 1st of the month and unrecognized spellings like 1hr reset at the next midnight, but the window start stepped back the literal duration, so now could land before the window and the elapsed floor inflated the projection into a false alert. The window start now mirrors get_next_standardized_reset_time, and a reset more than one window away no longer projects at all

---------

Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>
2026-10-08 12:02:40 -07:00
..
__init__.py
test_error_helpers.py
test_guardrail_merge.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_misc_helpers.py
test_model_access.py
test_month_end_projection.py fix(proxy): use budget reset window for projected spend alerts (#31942) 2026-10-08 12:02:40 -07:00
test_premium_user_check.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_team_configs.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_to_ns.py
test_url_helpers.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00