mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: mock prisma find_unique as AsyncMock in get_agent_by_id test
The endpoint now refreshes agent spend from DB when found in registry, so the test must provide an AsyncMock for the awaited find_unique call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9aa3afc8d7
commit
0b4cb09d6b
1 changed files with 3 additions and 0 deletions
|
|
@ -295,6 +295,9 @@ class TestAgentRBACInternalUser:
|
|||
return_value=_sample_agent_response()
|
||||
)
|
||||
with patch("litellm.proxy.proxy_server.prisma_client") as mock_prisma:
|
||||
mock_prisma.db.litellm_agentstable.find_unique = AsyncMock(
|
||||
return_value=MagicMock(spend=0.0)
|
||||
)
|
||||
resp = self.internal_client.get(
|
||||
"/v1/agents/agent-123", headers={"Authorization": "Bearer k"}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue