File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 62
62
KeyRequest ,
63
63
NewUserRequest ,
64
64
UpdateKeyRequest ,
65
+ SpendUpdateQueueItem ,
66
+ Litellm_EntityType ,
65
67
)
66
68
67
69
proxy_logging_obj = ProxyLogging (user_api_key_cache = DualCache ())
@@ -93,7 +95,13 @@ def prisma_client():
93
95
94
96
@pytest .mark .asyncio
95
97
async def test_batch_update_spend (prisma_client ):
96
- prisma_client .user_list_transactions ["test-litellm-user-5" ] = 23
98
+ await proxy_logging_obj .db_spend_update_writer .spend_update_queue .add_update (
99
+ SpendUpdateQueueItem (
100
+ entity_type = Litellm_EntityType .USER ,
101
+ entity_id = "test-litellm-user-5" ,
102
+ response_cost = 23 ,
103
+ )
104
+ )
97
105
setattr (litellm .proxy .proxy_server , "prisma_client" , prisma_client )
98
106
setattr (litellm .proxy .proxy_server , "master_key" , "sk-1234" )
99
107
await litellm .proxy .proxy_server .prisma_client .connect ()
You can’t perform that action at this time.
0 commit comments