mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-03 07:23:33 +00:00
* refactor(proxy): inject database repositories through per-repository dependencies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(proxy): model Prisma client cleanup * test(rust): include NativeDatabase in bridge API surface --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
18 lines
446 B
Python
18 lines
446 B
Python
from typing import Final
|
|
from unittest.mock import AsyncMock, MagicMock
|
|
|
|
import pytest
|
|
|
|
from litellm.repositories.database import Database
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_closing_the_database_closes_prisma() -> None:
|
|
prisma: Final = MagicMock()
|
|
prisma.aclose = AsyncMock()
|
|
database: Final = await Database.open(prisma)
|
|
|
|
prisma.aclose.assert_not_awaited()
|
|
await database.aclose()
|
|
|
|
prisma.aclose.assert_awaited_once()
|