forked from phoenix/litellm-mirror
(proxy fix) - call connect on prisma client when running setup (#6534)
* critical fix - call connect on prisma client when running setup * fix test_proxy_server_prisma_setup * fix test_proxy_server_prisma_setup
This commit is contained in:
parent
3b5776e9ec
commit
8bf0005012
2 changed files with 8 additions and 7 deletions
|
@ -1909,13 +1909,15 @@ async def test_proxy_server_prisma_setup():
|
|||
litellm.proxy.proxy_server, "PrismaClient", new=MagicMock()
|
||||
) as mock_prisma_client:
|
||||
mock_client = mock_prisma_client.return_value # This is the mocked instance
|
||||
mock_client.connect = AsyncMock() # Mock the connect method
|
||||
mock_client.check_view_exists = AsyncMock() # Mock the check_view_exists method
|
||||
|
||||
ProxyStartupEvent._setup_prisma_client(
|
||||
await ProxyStartupEvent._setup_prisma_client(
|
||||
database_url=os.getenv("DATABASE_URL"),
|
||||
proxy_logging_obj=ProxyLogging(user_api_key_cache=user_api_key_cache),
|
||||
user_api_key_cache=user_api_key_cache,
|
||||
)
|
||||
|
||||
await asyncio.sleep(1)
|
||||
# Verify our mocked methods were called
|
||||
mock_client.connect.assert_called_once()
|
||||
mock_client.check_view_exists.assert_called_once()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue