From e5d63af402357bf3c8be92cc94367fc751d5f71c Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 22 May 2026 18:28:03 -0700 Subject: [PATCH] test: also assert updated models in team-cache-refresh pin Strengthens the LIT-3244 regression test to also assert `call_kwargs["team_table"].models` matches the updated row, not just `team_id`. Both `existing_team` and `updated_team` share `team_id` in the test setup, so the previous assertion would have passed even if the implementation accidentally cached the pre-mutation row. Greptile review feedback. --- .../proxy/management_endpoints/test_team_endpoints.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py index 7c8d99c6d8f..4f08f77c8bb 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py @@ -1629,8 +1629,15 @@ async def test_team_model_add_delete_refresh_team_cache(endpoint_name): call_kwargs = mock_cache_team.await_args.kwargs assert call_kwargs["team_id"] == "team-1234" # The cached object must be built from the *updated* row, not the - # pre-mutation `existing_team` — that's the whole point. + # pre-mutation `existing_team` — that's the whole point. Both rows + # share team_id, so the only assertion that actually pins this is + # against the field that differs between them: `models`. assert call_kwargs["team_table"].team_id == "team-1234" + assert call_kwargs["team_table"].models == [ + "bedrock-claude-sonnet-4", + "openai/*", + "team-byok-1", + ] @pytest.mark.asyncio