File size: 578 Bytes
6d20eab | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_healing_evaluate_endpoint():
payload = {
"event": {
"component": "my-service",
"latency_p99": 450.0,
"error_rate": 0.25,
"service_mesh": "default",
"cpu_util": 0.85,
"memory_util": 0.90
}
}
response = client.post("/api/v1/healing/evaluate", json=payload)
assert response.status_code == 200, f"Expected 200, got {
response.status_code}: {
response.text}"
|