From 655e75276e156cb28d0df8c214523182076a28af Mon Sep 17 00:00:00 2001 From: harish-berri Date: Fri, 24 Apr 2026 01:44:08 +0000 Subject: [PATCH] Enhance team endpoint tests by integrating AsyncMock for cache methods, ensuring proper asynchronous behavior in test_update_team_guardrails_with_org_id. This improves test reliability and aligns with recent caching improvements. --- .../proxy/management_endpoints/test_team_endpoints.py | 3 +++ 1 file changed, 3 insertions(+) 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 f1e077b5e4a..65015b9d6b6 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py @@ -5151,6 +5151,9 @@ async def test_update_team_guardrails_with_org_id(): return_value=mock_updated_team ) mock_prisma.jsonify_team_object = MagicMock(side_effect=lambda db_data: db_data) + # async_get_cache must be an AsyncMock so `await` in get_org_object works + mock_cache.async_get_cache = AsyncMock(return_value=None) + mock_cache.async_set_cache = AsyncMock() # Mock llm_router mock_router = MagicMock()