From 1a6ce18e572111dcfd35bc85b81f216b67df4ac1 Mon Sep 17 00:00:00 2001 From: "Islomjon (Toji)" Date: Fri, 30 Oct 2026 14:33:06 +0900 Subject: [PATCH] test(aiand): derive retired models from the rows instead of pinning dates The wildcard test now reads each row's deprecation_date, so it holds whichever dates ai& sets, and the test that only restated the JSON dates is gone --- .../llms/openai_like/test_aiand_provider.py | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/tests/unit/llms/openai_like/test_aiand_provider.py b/tests/unit/llms/openai_like/test_aiand_provider.py index 24eac499511..5d1d554f0da 100644 --- a/tests/unit/llms/openai_like/test_aiand_provider.py +++ b/tests/unit/llms/openai_like/test_aiand_provider.py @@ -90,32 +90,19 @@ def _aiand_catalog() -> frozenset[str]: return frozenset(name for name, info in litellm.model_cost.items() if info.get("litellm_provider") == "aiand") -AIAND_RETIREMENT_DATES: Final = { - "aiand/deepseek-ai/deepseek-v4-flash": "2026-10-27", - "aiand/zai-org/glm-5.2": "2026-10-27", - "aiand/moonshotai/kimi-k2.7-code": "2026-10-27", - "aiand/deepseek-ai/deepseek-v4.1-flash": "2026-11-06", -} - - -def test_aiand_wildcard_lists_only_its_live_models(): +def test_aiand_wildcard_lists_only_models_not_yet_retired(): catalog: Final = _aiand_catalog() - retired: Final = frozenset( - model - for model, retired_on in AIAND_RETIREMENT_DATES.items() - if datetime.date.fromisoformat(retired_on) <= datetime.date.today() + name + for name in catalog + if (retired_on := litellm.model_cost[name].get("deprecation_date")) is not None + and datetime.date.fromisoformat(retired_on) <= datetime.date.today() ) - assert frozenset(AIAND_RETIREMENT_DATES) < catalog + assert catalog - retired assert frozenset(get_known_models_from_wildcard("aiand/*")) == catalog - retired -def test_aiand_retired_models_carry_their_retirement_date(): - for model, retired_on in AIAND_RETIREMENT_DATES.items(): - assert litellm.model_cost[model]["deprecation_date"] == retired_on - - def test_aiand_calls_are_billed_from_their_cost_rows(): catalog: Final = _aiand_catalog() assert catalog