mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-25 16:26:52 +00:00
fix test rules
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user