mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
tests: mock LiteLLM_UserTable for CloudZero export
This commit is contained in:
parent
b6664669d2
commit
bdc35b4cd2
1 changed files with 8 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ from litellm.integrations.cloudzero.cz_stream_api import CloudZeroStreamer
|
|||
from litellm.integrations.cloudzero.database import LiteLLMDatabase
|
||||
|
||||
|
||||
|
||||
class TestCloudZeroHourlyExport:
|
||||
@pytest.mark.asyncio
|
||||
async def test_hourly_export(self):
|
||||
|
|
@ -50,6 +51,12 @@ class TestCloudZeroHourlyExport:
|
|||
"token": ["sk-test-cloudzero-token-010"],
|
||||
}
|
||||
)
|
||||
user_mock_data = pl.LazyFrame(
|
||||
{
|
||||
"user_id": ["069e8205-8f55-44fd-870b-0c036cab600c"],
|
||||
"user_email": ["user@example.com"],
|
||||
}
|
||||
)
|
||||
|
||||
with (
|
||||
patch.object(LiteLLMDatabase, "_ensure_prisma_client") as mock_prisma_client_getter,
|
||||
|
|
@ -64,6 +71,7 @@ class TestCloudZeroHourlyExport:
|
|||
LiteLLM_DailyUserSpend=spend_mock_data,
|
||||
LiteLLM_VerificationToken=verification_mock_data,
|
||||
LiteLLM_TeamTable=team_mock_data,
|
||||
LiteLLM_UserTable=user_mock_data,
|
||||
)
|
||||
result = sql_context.execute(query).collect()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue