From 923ac2303beedafea7a5f16e088eda586e8ff098 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 31 Mar 2025 20:55:13 -0700 Subject: [PATCH] test_end_user_transactions_reset --- tests/proxy_unit_tests/test_proxy_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py index d613118fc89..31c9711b0eb 100644 --- a/tests/proxy_unit_tests/test_proxy_utils.py +++ b/tests/proxy_unit_tests/test_proxy_utils.py @@ -1509,13 +1509,16 @@ from litellm.proxy.utils import ProxyUpdateSpend async def test_end_user_transactions_reset(): # Setup mock_client = MagicMock() - mock_client.end_user_list_transactions = {"1": 10.0} # Bad log + end_user_list_transactions = {"1": 10.0} # Bad log mock_client.db.tx = AsyncMock(side_effect=Exception("DB Error")) # Call function - should raise error with pytest.raises(Exception): await ProxyUpdateSpend.update_end_user_spend( - n_retry_times=0, prisma_client=mock_client, proxy_logging_obj=MagicMock() + n_retry_times=0, + prisma_client=mock_client, + proxy_logging_obj=MagicMock(), + end_user_list_transactions=end_user_list_transactions, ) # Verify cleanup happened