test(router): assert a non-chat configured mode round-trips

With every kept get_configured_mode test using mode "chat", a Router that
answered "chat" for any non-blank configured mode passed all four of them
(the deleted #39630 pair's audio_speech case was the only test catching it).
Read the mode back as audio_speech on an unmapped model so the configured
value itself is what the test checks. Six hand-applied mutations of
Router.get_configured_mode, including that hardcoded-chat one, are now all
killed by the four surviving tests.
This commit is contained in:
mateo-berri 2026-09-03 15:38:15 -07:00
parent ea12510f1a
commit 1d71e306cc

View file

@ -7362,14 +7362,14 @@ def test_get_configured_mode_reads_deployment_model_info():
router = litellm.Router(
model_list=[
{
"model_name": "chat-model",
"litellm_params": {"model": "openai/some-unmapped-model"},
"model_info": {"mode": "chat"},
"model_name": "tts-model",
"litellm_params": {"model": "openai/some-unmapped-tts-model"},
"model_info": {"mode": "audio_speech"},
}
]
)
assert router.get_configured_mode("chat-model") == "chat"
assert router.get_configured_mode("tts-model") == "audio_speech"
def test_get_configured_mode_returns_none_for_unset_or_unknown():