From 23357e93696170cc695429b4c297b95ef5a0bf34 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 2 Feb 2024 11:16:51 -0800 Subject: [PATCH] test: fix import --- litellm/tests/test_key_generate_dynamodb.py | 12 ++++++++--- litellm/tests/test_key_generate_prisma.py | 24 +++++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/litellm/tests/test_key_generate_dynamodb.py b/litellm/tests/test_key_generate_dynamodb.py index bacb886d879..9963ba2c0a1 100644 --- a/litellm/tests/test_key_generate_dynamodb.py +++ b/litellm/tests/test_key_generate_dynamodb.py @@ -287,7 +287,9 @@ def test_call_with_user_over_budget_stream(custom_db_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( @@ -359,7 +361,9 @@ def test_call_with_user_key_budget(custom_db_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( @@ -431,7 +435,9 @@ def test_call_with_key_over_budget_stream(custom_db_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( diff --git a/litellm/tests/test_key_generate_prisma.py b/litellm/tests/test_key_generate_prisma.py index 5e0cefd2de8..831a6a6f721 100644 --- a/litellm/tests/test_key_generate_prisma.py +++ b/litellm/tests/test_key_generate_prisma.py @@ -325,7 +325,9 @@ def test_call_with_proxy_over_budget(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( @@ -403,7 +405,9 @@ def test_call_with_user_over_budget_stream(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( @@ -490,7 +494,9 @@ def test_call_with_proxy_over_budget_stream(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage resp = ModelResponse( @@ -893,7 +899,9 @@ def test_call_with_key_over_budget(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage from litellm.caching import Cache @@ -985,7 +993,9 @@ async def test_call_with_key_never_over_budget(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage import time @@ -1060,7 +1070,9 @@ async def test_call_with_key_over_budget_stream(prisma_client): print("result from user auth with new key", result) # update spend using track_cost callback, make 2nd request, it should fail - from litellm.proxy.proxy_server import track_cost_callback + from litellm.proxy.proxy_server import ( + _PROXY_track_cost_callback as track_cost_callback, + ) from litellm import ModelResponse, Choices, Message, Usage import time