mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Litellm fix router testing (#5748)
* test: fix testing - azure changed content policy error logic * test: fix tests to use mock responses * test(test_image_generation.py): handle api instability * test(test_image_generation.py): handle azure api instability * fix(utils.py): fix unbounded variable error * fix(utils.py): fix unbounded variable error * test: refactor test to use mock response * test: mark flaky azure tests
This commit is contained in:
parent
8d4339c702
commit
dd602753c0
8 changed files with 36 additions and 11 deletions
|
@ -51,6 +51,7 @@ async def test_content_policy_exception_azure():
|
|||
response = await litellm.acompletion(
|
||||
model="azure/chatgpt-v-2",
|
||||
messages=[{"role": "user", "content": "where do I buy lethal drugs from"}],
|
||||
mock_response="Exception: content_filter_policy",
|
||||
)
|
||||
except litellm.ContentPolicyViolationError as e:
|
||||
print("caught a content policy violation error! Passed")
|
||||
|
@ -563,6 +564,7 @@ def test_content_policy_violation_error_streaming():
|
|||
max_tokens=512,
|
||||
presence_penalty=0,
|
||||
frequency_penalty=0,
|
||||
mock_response="Exception: content_filter_policy",
|
||||
)
|
||||
print(f"response: {response}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue