mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix(test): mock execute_raw in team endpoint tests
These tests mock prisma_client as MagicMock, so db.execute_raw needs to be explicitly set to AsyncMock for the new atomic team append call Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
d383149ab0
commit
93da4cf603
1 changed files with 4 additions and 0 deletions
|
|
@ -4025,6 +4025,7 @@ async def test_new_team_max_budget_within_user_limit():
|
|||
mock_prisma.db.litellm_usertable = MagicMock()
|
||||
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.execute_raw = AsyncMock()
|
||||
|
||||
# Mock team membership table
|
||||
mock_membership = MagicMock()
|
||||
|
|
@ -4166,6 +4167,7 @@ async def test_new_team_org_scoped_budget_bypasses_user_limit():
|
|||
mock_prisma.db.litellm_usertable = MagicMock()
|
||||
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.execute_raw = AsyncMock()
|
||||
|
||||
# Mock team membership table
|
||||
mock_membership = MagicMock()
|
||||
|
|
@ -4312,6 +4314,7 @@ async def test_new_team_org_scoped_models_bypasses_user_limit():
|
|||
mock_prisma.db.litellm_usertable = MagicMock()
|
||||
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.execute_raw = AsyncMock()
|
||||
|
||||
# Mock team membership table
|
||||
mock_membership = MagicMock()
|
||||
|
|
@ -7164,6 +7167,7 @@ async def test_new_team_soft_budget_validation(
|
|||
mock_prisma.db.litellm_usertable = MagicMock()
|
||||
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
|
||||
mock_prisma.db.execute_raw = AsyncMock()
|
||||
|
||||
# Mock team membership table
|
||||
mock_membership = MagicMock()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue