mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
(test) all tests should pass now
This commit is contained in:
parent
0011f9efa1
commit
6235ab6687
1 changed files with 3 additions and 2 deletions
|
@ -168,7 +168,7 @@ def test_call_with_key_under_budget():
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
model="gpt-35-turbo", # azure always has model written like this
|
model="gpt-35-turbo", # azure always has model written like this
|
||||||
usage=Usage(prompt_tokens=21, completion_tokens=17, total_tokens=38),
|
usage=Usage(prompt_tokens=210, completion_tokens=200, total_tokens=410),
|
||||||
)
|
)
|
||||||
await track_cost_callback(
|
await track_cost_callback(
|
||||||
kwargs={
|
kwargs={
|
||||||
|
@ -186,10 +186,11 @@ def test_call_with_key_under_budget():
|
||||||
# use generated key to auth in
|
# use generated key to auth in
|
||||||
result = await user_api_key_auth(request=request, api_key=bearer_token)
|
result = await user_api_key_auth(request=request, api_key=bearer_token)
|
||||||
print("result from user auth with new key", result)
|
print("result from user auth with new key", result)
|
||||||
|
pytest.fail(f"This should have failed!. They key crossed it's budget")
|
||||||
|
|
||||||
asyncio.run(test())
|
asyncio.run(test())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
assert "ExceededBudget:" in str(e)
|
pass
|
||||||
print("Got Exception", e)
|
print("Got Exception", e)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue