Spaces:
Sleeping
Sleeping
File size: 686 Bytes
622b3c4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import subprocess
import time
import requests
BBOX = {
"north_east": {"lat": 40.0, "lon": -73.0},
"south_west": {"lat": 39.0, "lon": -74.0},
}
def start_server():
proc = subprocess.Popen(
["uvicorn", "api.app:app", "--port", "8001", "--host", "127.0.0.1"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
# give uvicorn a moment to boot
time.sleep(2)
return proc
def test_e2e_health_and_chat():
proc = start_server()
try:
# health check
r = requests.get("http://127.0.0.1:8001/health")
assert r.status_code == 200
assert r.json()["status"] == "ok"
finally:
proc.terminate()
|