16 lines
354 B
Python
16 lines
354 B
Python
from fastapi.testclient import TestClient
|
|
from main import app
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_health_endpoint():
|
|
response = client.get("/health")
|
|
assert response.status_code == 200
|
|
assert response.json() == {"status": "ok"}
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_result = test_health_endpoint()
|
|
print("Health endpoint test passed!")
|