mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
test: alias replica_db on managed file and membership prisma doubles
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
a38cb9bfd4
commit
7c35f94a3c
3 changed files with 4 additions and 1 deletions
|
|
@ -181,6 +181,8 @@ class _UnreachableMembershipPrisma:
|
|||
async def find_unique(where: dict[str, dict[str, str]], include: dict[str, bool]) -> None:
|
||||
raise httpx.ConnectError("All connection attempts failed")
|
||||
|
||||
replica_db = db
|
||||
|
||||
|
||||
async def test_resolve_marks_a_membership_read_that_hits_a_db_outage_as_degraded():
|
||||
loaders = _Loaders(user=_user(), team=_team())
|
||||
|
|
|
|||
|
|
@ -1165,6 +1165,7 @@ async def test_create__uses_acreate_batch_route_type(harness, openai_env_creds):
|
|||
|
||||
def install_managed_files_hook(harness: Harness) -> AsyncMock:
|
||||
prisma_client = AsyncMock()
|
||||
prisma_client.replica_db = prisma_client.db
|
||||
managed_files = _PROXY_LiteLLMManagedFiles(MagicMock(async_set_cache=AsyncMock()), prisma_client=prisma_client)
|
||||
harness.logging.post_call_success_hook = AsyncMock(side_effect=managed_files.async_post_call_success_hook)
|
||||
harness.router.model_list = []
|
||||
|
|
@ -1182,7 +1183,6 @@ def assert_ownership_registered_for_team_a(prisma_client: AsyncMock, batch_id: s
|
|||
assert created["created_by"] == "user_a"
|
||||
assert created["team_id"] == "team_a"
|
||||
prisma_client.db.litellm_managedobjecttable.update_many.assert_not_awaited()
|
||||
prisma_client.replica_db = prisma_client.db
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
|
|
@ -4687,6 +4687,7 @@ def _setup_unscoped_list_files_route_over_real_hook(
|
|||
internal_usage_cache=MagicMock(), prisma_client=MagicMock()
|
||||
)
|
||||
managed_files.prisma_client.db.litellm_managedfiletable = _ManagedFileTableOverRows(rows)
|
||||
managed_files.prisma_client.replica_db = managed_files.prisma_client.db
|
||||
|
||||
proxy_logging_obj = setup_proxy_logging_object(monkeypatch, llm_router)
|
||||
proxy_logging_obj.proxy_hook_mapping["managed_files"] = managed_files
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue