mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
(test) content policy violation error
This commit is contained in:
parent
09874cc83f
commit
cf98343eb5
1 changed files with 18 additions and 0 deletions
|
@ -352,6 +352,24 @@ def test_completion_mistral_exception():
|
|||
# test_completion_mistral_exception()
|
||||
|
||||
|
||||
def test_content_policy_exceptionimage_generation_openai():
|
||||
try:
|
||||
litellm.set_verbose = True
|
||||
response = litellm.image_generation(
|
||||
prompt="a very bad prompt", model="dall-e-3"
|
||||
)
|
||||
print(f"response: {response}")
|
||||
assert len(response.data) > 0
|
||||
except litellm.ContentPolicyViolationError as e:
|
||||
print("caught a content policy violation error! Passed")
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"An exception occurred - {str(e)}")
|
||||
|
||||
|
||||
# test_image_generation_openai()
|
||||
|
||||
|
||||
# # test_invalid_request_error(model="command-nightly")
|
||||
# # Test 3: Rate Limit Errors
|
||||
# def test_model_call(model):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue