test(test_proxy_server_keys.py): add logic for connecting/disconnecting from http server

This commit is contained in:
Krrish Dholakia 2024-01-06 14:09:10 +05:30
parent b51d98c6e3
commit 5c45e69a5e

View file

@ -29,6 +29,7 @@ from litellm.proxy.proxy_server import (
router,
save_worker_config,
startup_event,
shutdown_event,
) # Replace with the actual module where your FastAPI router is defined
filepath = os.path.dirname(os.path.abspath(__file__))
@ -60,6 +61,11 @@ async def wrapper_startup_event():
await startup_event()
@app.on_event("shutdown")
async def wrapper_shutdown_event():
await shutdown_event()
# Here you create a fixture that will be used by your tests
# Make sure the fixture returns TestClient(app)
@pytest.fixture(autouse=True)