fix test rules

This commit is contained in:
Ishaan Jaff
2024-07-13 13:23:23 -07:00
parent bcc89a2c3a
commit bba748eaf4
+8 -7
View File
@@ -1,14 +1,18 @@
#### What this tests ####
# This tests setting rules before / after making llm api calls
import sys, os, time
import traceback, asyncio
import asyncio
import os
import sys
import time
import traceback
import pytest
sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system path
import litellm
from litellm import completion, acompletion
from litellm import acompletion, completion
def my_pre_call_rule(input: str):
@@ -126,10 +130,7 @@ def test_post_call_rule_streaming():
print("Got exception", e)
print(type(e))
print(vars(e))
assert (
"OpenAIException - This violates LiteLLM Proxy Rules. Response too short"
in e.message
)
assert "This violates LiteLLM Proxy Rules. Response too short" in e.message
@pytest.mark.asyncio