litellm/tests/litellm
Krish Dholakia 290e2528cd
Schedule budget resets at expectable times (#10331) (#10333)
* Schedule budget resets at expectable times (#10331)

* Enhance budget reset functionality with timezone support and standardized reset times

- Added `get_next_standardized_reset_time` function to calculate budget reset times based on specified durations and timezones.
- Introduced `timezone_utils.py` to manage timezone retrieval and budget reset time calculations.
- Updated budget reset logic in `reset_budget_job.py`, `internal_user_endpoints.py`, `key_management_endpoints.py`, and `team_endpoints.py` to utilize the new timezone-aware reset time calculations.
- Added unit tests for the new reset time functionality in `test_duration_parser.py`.
- Updated `.gitignore` to include `test.py` and made minor formatting adjustments in `docker-compose.yml` for consistency.

* Fixed linting

* Fix for mypy

* Fixed testcase for reset

* fix(duration_parser.py): move off zoneinfo - doesn't work with python 3.8

* test: update test

* refactor: improve budget reset time calculation and update related tests for accuracy

* clean up imports in team_endpoints.py

* test: update budget remaining hours assertions to reflect new reset time logic

* build(model_prices_and_context_window.json): update model

---------

Co-authored-by: Prathamesh Saraf <pratamesh1867@gmail.com>
2025-04-29 20:59:44 -07:00
..
caching update redisvl dependency 2025-03-24 08:42:11 -04:00
enterprise [Feat Security] - Allow blocking web crawlers (#10420) 2025-04-29 17:28:08 -07:00
experimental_mcp_client rename transform_openai_tool_call_request_to_mcp_tool_call_request 2025-03-29 16:28:23 -07:00
integrations feat: Added Missing Attributes For Arize & Phoenix Integration (#10043) (#10215) 2025-04-22 21:34:51 -07:00
litellm_core_utils Schedule budget resets at expectable times (#10331) (#10333) 2025-04-29 20:59:44 -07:00
llms Handle more gemini tool calling edge cases + support bedrock 'stable-image-core' (#10351) 2025-04-28 14:22:29 -07:00
proxy Schedule budget resets at expectable times (#10331) (#10333) 2025-04-29 20:59:44 -07:00
responses [Bug Fix] Responses API - fix for handling multiturn responses API sessions (#10415) 2025-04-29 17:22:47 -07:00
router_strategy Revert "Unit test fixing and poetry update" 2025-03-28 10:22:32 -07:00
router_utils/pre_call_checks [Feat] Add Responses API - Routing Affinity logic for sessions (#10193) 2025-04-21 20:00:27 -07:00
types/llms Litellm dev 04 22 2025 p1 (#10206) 2025-04-22 23:58:43 -07:00
conftest.py fix(proxy_server.py): get master key from environment, if not set in … (#9617) 2025-03-28 15:16:15 -07:00
log.txt Support format param for specifying image type (#9019) 2025-03-05 19:52:53 -08:00
readme.md
test_cost_calculator.py Fix - support azure dall e custom pricing (#10339) 2025-04-26 17:16:03 -07:00
test_main.py fix #8425, passthrough kwargs during acompletion, and unwrap extra_body for openrouter (#9747) 2025-04-03 22:19:40 -07:00
test_router.py UI - fix edit azure public model name + fix editing model name post create 2025-04-23 21:56:56 -07:00

Testing for litellm/

This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.

The point of this is to:

  1. Increase test coverage of litellm/
  2. Make it easy for contributors to add tests for the litellm/ package and easily run tests without needing LLM API keys.

File name conventions

  • litellm/proxy/test_caching_routes.py maps to litellm/proxy/caching_routes.py
  • test_<filename>.py maps to litellm/<filename>.py