From e0eda3d981e2d424f37e5e7cc16cbaafe02ade99 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 27 Feb 2026 18:53:28 +0000 Subject: [PATCH] fix: mock prisma_client in internal user get-agent-by-id test Co-authored-by: Ishaan Jaff --- tests/test_litellm/proxy/agent_endpoints/test_endpoints.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py b/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py index d57f89cfbfc..fcf8f048190 100644 --- a/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py +++ b/tests/test_litellm/proxy/agent_endpoints/test_endpoints.py @@ -294,9 +294,10 @@ class TestAgentRBACInternalUser: self.mock_registry.get_agent_by_id = MagicMock( return_value=_sample_agent_response() ) - resp = self.internal_client.get( - "/v1/agents/agent-123", headers={"Authorization": "Bearer k"} - ) + with patch("litellm.proxy.proxy_server.prisma_client") as mock_prisma: + resp = self.internal_client.get( + "/v1/agents/agent-123", headers={"Authorization": "Bearer k"} + ) assert resp.status_code == 200 def test_should_block_internal_user_from_creating_agent(self):