mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(test) switch dynamodb test to use new exceptions
This commit is contained in:
parent
feb367bbb9
commit
d2675a1ff3
1 changed files with 7 additions and 7 deletions
|
@ -109,8 +109,8 @@ def test_call_with_invalid_key(custom_db_client):
|
|||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
print("Got Exception", e)
|
||||
print(e.detail)
|
||||
assert "Authentication Error" in e.detail
|
||||
print(e.message)
|
||||
assert "Authentication Error" in e.message
|
||||
pass
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ def test_call_with_invalid_model(custom_db_client):
|
|||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
assert (
|
||||
e.detail
|
||||
e.message
|
||||
== "Authentication Error, API Key not allowed to access model. This token can only access models=['mistral']. Tried to access gemini-pro-vision"
|
||||
)
|
||||
pass
|
||||
|
@ -248,7 +248,7 @@ def test_call_with_user_over_budget(custom_db_client):
|
|||
|
||||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
error_detail = e.detail
|
||||
error_detail = e.message
|
||||
assert "Authentication Error, ExceededBudget:" in error_detail
|
||||
print(vars(e))
|
||||
|
||||
|
@ -321,7 +321,7 @@ def test_call_with_user_over_budget_stream(custom_db_client):
|
|||
|
||||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
error_detail = e.detail
|
||||
error_detail = e.message
|
||||
assert "Authentication Error, ExceededBudget:" in error_detail
|
||||
print(vars(e))
|
||||
|
||||
|
@ -392,7 +392,7 @@ def test_call_with_user_key_budget(custom_db_client):
|
|||
|
||||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
error_detail = e.detail
|
||||
error_detail = e.message
|
||||
assert "Authentication Error, ExceededTokenBudget:" in error_detail
|
||||
print(vars(e))
|
||||
|
||||
|
@ -465,6 +465,6 @@ def test_call_with_key_over_budget_stream(custom_db_client):
|
|||
|
||||
asyncio.run(test())
|
||||
except Exception as e:
|
||||
error_detail = e.detail
|
||||
error_detail = e.message
|
||||
assert "Authentication Error, ExceededTokenBudget:" in error_detail
|
||||
print(vars(e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue