From 33afc74b601d597cb615d1434c424c3698529941 Mon Sep 17 00:00:00 2001 From: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> Date: Sat, 26 Sep 2026 15:24:24 -0700 Subject: [PATCH] test(agents): supply writer responses in admission fixtures --- tests/test_litellm/proxy/agent_endpoints/test_endpoints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py b/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py index 7f316f9ca5b..701e575bce1 100644 --- a/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py +++ b/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py @@ -351,6 +351,7 @@ class TestAgentByIdKeyRedaction: test_client = _make_app_with_role(role) with patch("litellm.proxy.proxy_server.prisma_client") as mock_prisma: + mock_prisma.writer_db = mock_prisma.db mock_prisma.db.litellm_agentstable.find_unique = AsyncMock( return_value=None ) @@ -413,6 +414,7 @@ class TestAgentRBACInternalUser: return_value=_sample_agent_response() ) with patch("litellm.proxy.proxy_server.prisma_client") as mock_prisma: + mock_prisma.writer_db = mock_prisma.db mock_prisma.db.litellm_agentstable.find_unique = AsyncMock( return_value=None ) @@ -1343,6 +1345,7 @@ def test_get_agent_redacts_kill_switch_secret_for_admins_and_hides_it_from_other def _get_as(role: LitellmUserRoles): with patch("litellm.proxy.proxy_server.prisma_client") as mock_prisma: + mock_prisma.writer_db = mock_prisma.db mock_prisma.db.litellm_agentstable.find_unique = AsyncMock(return_value=None) mock_prisma.db.litellm_verificationtoken.find_many = AsyncMock(return_value=[]) return _make_app_with_role(role).get("/v1/agents/agent-123", headers={"Authorization": "Bearer k"}) @@ -1384,6 +1387,7 @@ def test_agent_identity_configuration_is_only_returned_to_admins(role, path, mon prisma.db.litellm_agentstable.find_unique = AsyncMock(return_value=None) prisma.db.litellm_agentstable.find_many = AsyncMock(return_value=[]) prisma.db.litellm_verificationtoken.find_many = AsyncMock(return_value=[]) + prisma.writer_db.litellm_agentstable.find_unique = AsyncMock(return_value=None) response = _make_app_with_role(role).get(path, headers={"Authorization": "Bearer k"}) assert response.status_code == 200 payload = response.json()[0] if path == "/v1/agents" else response.json()