From bdc35b4cd27389fb312877ecca629259a0d98273 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 5 Jan 2026 17:23:04 +0900 Subject: [PATCH] tests: mock LiteLLM_UserTable for CloudZero export --- .../test_litellm/integrations/cloudzero/test_cloudzero.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_litellm/integrations/cloudzero/test_cloudzero.py b/tests/test_litellm/integrations/cloudzero/test_cloudzero.py index db6726a234d..31a2f6cbf51 100644 --- a/tests/test_litellm/integrations/cloudzero/test_cloudzero.py +++ b/tests/test_litellm/integrations/cloudzero/test_cloudzero.py @@ -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()