forked from phoenix/litellm-mirror
fix remove unused test
This commit is contained in:
parent
048c137f86
commit
9e040e12fc
1 changed files with 0 additions and 62 deletions
|
@ -96,65 +96,3 @@ def test_litellm_proxy_server_config_no_general_settings():
|
|||
|
||||
# Additional assertions can be added here
|
||||
assert True
|
||||
|
||||
|
||||
def _put_sso_on():
|
||||
os.environ["GOOGLE_CLIENT_ID"] = "xxxx"
|
||||
os.environ["GOOGLE_CLIENT_SECRET"] = "xxxx"
|
||||
|
||||
|
||||
def test_litellm_proxy_server_config_with_prometheus():
|
||||
# Install the litellm[proxy] package
|
||||
# Start the server
|
||||
server_process = None
|
||||
try:
|
||||
_put_sso_on()
|
||||
_old_license = os.environ.pop("LITELLM_LICENSE", None)
|
||||
subprocess.run(["pip", "install", "-U", "litellm[proxy]"])
|
||||
subprocess.run(["pip", "install", "-U", "litellm[extra_proxy]"])
|
||||
filepath = os.path.dirname(os.path.abspath(__file__))
|
||||
config_fp = f"{filepath}/test_configs/test_enterprise_config.yaml"
|
||||
server_process = subprocess.Popen(
|
||||
[
|
||||
"python3",
|
||||
"-m",
|
||||
"litellm.proxy.proxy_cli",
|
||||
"--config",
|
||||
config_fp,
|
||||
]
|
||||
)
|
||||
|
||||
# Allow some time for the server to start
|
||||
time.sleep(60) # Adjust the sleep time if necessary
|
||||
|
||||
# Send a request to the /health/liveliness endpoint
|
||||
response = requests.get("http://localhost:4000/health/liveliness")
|
||||
print("response= ", response.json())
|
||||
|
||||
# Check if the response is successful
|
||||
assert response.status_code == 200
|
||||
assert response.json() == "I'm alive!"
|
||||
|
||||
# Test /chat/completions
|
||||
response = requests.post(
|
||||
"http://localhost:4000/chat/completions",
|
||||
headers={"Authorization": "Bearer 1234567890"},
|
||||
json={
|
||||
"model": "test_openai_models",
|
||||
"messages": [{"role": "user", "content": "Hello, how are you?"}],
|
||||
},
|
||||
)
|
||||
print("response= ", response.json())
|
||||
assert response.status_code == 200
|
||||
|
||||
except ImportError:
|
||||
pytest.fail("Failed to import litellm.proxy_server")
|
||||
except requests.ConnectionError:
|
||||
pytest.fail("Failed to connect to the server")
|
||||
finally:
|
||||
# Shut down the server
|
||||
if _old_license:
|
||||
os.environ["LITELLM_LICENSE"] = _old_license
|
||||
if server_process:
|
||||
server_process.terminate()
|
||||
server_process.wait()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue