litellm/tests/router_unit_tests
ByteWise 14b4e9c0c3 fix(router): respect prompt cache affinity ttl
Derive the router affinity cache TTL from the cacheable prompt prefix so one-hour ephemeral cache hints stay routable for their advertised lifetime instead of expiring after the previous five-minute default.

Related: BerriAI/litellm#28427

Tested: python -m pytest tests/router_unit_tests/test_router_prompt_caching.py -q; python -m pytest tests/test_litellm/test_prompt_caching_cache.py -q; python -m ruff check litellm/router_utils/prompt_caching_cache.py tests/router_unit_tests/test_router_prompt_caching.py tests/test_litellm/test_prompt_caching_cache.py; python -m black litellm/router_utils/prompt_caching_cache.py tests/router_unit_tests/test_router_prompt_caching.py tests/test_litellm/test_prompt_caching_cache.py

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-21 17:32:02 +08:00
..
conftest.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
create_mock_standard_logging_payload.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
gettysburg.wav test(router_code_coverage.py): check if all router functions are dire… (#6186) 2024-10-14 22:44:00 -07:00
README.md test(router_code_coverage.py): check if all router functions are dire… (#6186) 2024-10-14 22:44:00 -07:00
test_completion_no_copy.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_default_deployment_copy.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_get_model_list_alias_optimization.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_pre_call_checks_optimization.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_prompt_management_check.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_acancel_batch.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_adding_deployments.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_router_aresponses_streaming_fallback.py Litellm oss staging 1 (#28337) 2026-05-20 17:27:03 -07:00
test_router_batch_utils.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_cooldown_utils.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_embedding_headers.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_embedding_integration.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_endpoints.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_handle_error.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_helper_utils.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_index_management.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_router_prompt_caching.py fix(router): respect prompt cache affinity ttl 2026-05-21 17:32:02 +08:00

Router component unit tests.

Please name all files with the word 'router' in them.

This is used to ensure all functions in the router are tested.