Context
CashPilot runs a health check scheduler every 5 minutes that records container state in the health_events table. The health score (0-100) is calculated from uptime and restart frequency.
Task
- Write a test that simulates health events (start, check_ok, check_down, restart)
- Verify the health score calculation produces expected values
- Verify the
/api/health/scores endpoint returns scores in the correct format
Reference
app/main.py — health check scheduler and API endpoints
app/database.py — health_events table