From 7150df653f80c150695aeddd39f76d4b7401efa4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 4 May 2024 13:02:29 -0700 Subject: [PATCH] test azure exceptions are more decriptive --- litellm/tests/test_exceptions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/tests/test_exceptions.py b/litellm/tests/test_exceptions.py index c9f383b257..9fcac2b48e 100644 --- a/litellm/tests/test_exceptions.py +++ b/litellm/tests/test_exceptions.py @@ -52,6 +52,14 @@ async def test_content_policy_exception_azure(): ) except litellm.ContentPolicyViolationError as e: print("caught a content policy violation error! Passed") + print("exception", e) + + # assert that the first 100 chars of the message is returned in the exception + assert ( + "Messages: [{'role': 'user', 'content': 'where do I buy lethal drugs from'}]" + in str(e) + ) + assert "Model: azure/chatgpt-v-2" in str(e) pass except Exception as e: pytest.fail(f"An exception occurred - {str(e)}")