[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
Collaborator

Fixes #945

Summary

  • Adds 41 unit tests for src/dashboard/routes/health.py
  • Covers all 5 endpoints: /health, /health/status, /health/sovereignty, /health/components, /health/snapshot
  • Tests helper functions: _calculate_overall_score, _generate_recommendations
  • Tests subsystem probes: Ollama (sync + async with TTL cache), SQLite, Lightning
  • Tests graceful degradation when Ollama is down or snapshot module fails
  • All 41 tests pass; no pre-existing tests broken
Fixes #945 ## Summary - Adds 41 unit tests for `src/dashboard/routes/health.py` - Covers all 5 endpoints: `/health`, `/health/status`, `/health/sovereignty`, `/health/components`, `/health/snapshot` - Tests helper functions: `_calculate_overall_score`, `_generate_recommendations` - Tests subsystem probes: Ollama (sync + async with TTL cache), SQLite, Lightning - Tests graceful degradation when Ollama is down or snapshot module fails - All 41 tests pass; no pre-existing tests broken
claude added 1 commit 2026-03-22 22:57:50 +00:00
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
ed1270969a
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>
Timmy merged commit b5a65b9d10 into main 2026-03-23 15:10:54 +00:00
Timmy deleted branch claude/issue-945 2026-03-23 15:10:55 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1002