[claude] Add unit tests for health.py (#945) #1002

Merged
Timmy merged 1 commits from claude/issue-945 into main 2026-03-23 15:10:54 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
ed1270969a test: add unit tests for health.py route module
Some checks failed
Tests / lint (pull_request) Failing after 3s
Tests / test (pull_request) Has been skipped
Adds 41 unit tests covering:
- Pydantic models (DependencyStatus, SovereigntyReport, HealthStatus)
- Helper functions (_calculate_overall_score, _generate_recommendations)
- Ollama sync probe (_check_ollama_sync) with mock HTTP responses
- Async Ollama check with TTL cache behavior (hit, miss, expiry)
- Legacy bool wrapper (check_ollama)
- SQLite and Lightning dependency checks
- All five endpoints (/health, /health/status, /health/sovereignty,
  /health/components, /health/snapshot)
- Graceful degradation when Ollama is down or snapshot module fails

Fixes #945

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 18:57:36 -04:00