[kimi-task] Add unit tests for src/dashboard/routes/health.py #770

Closed
opened 2026-03-21 19:16:47 +00:00 by Timmy · 3 comments
Owner

Type: Test coverage

File: src/dashboard/routes/health.py

Health endpoints have no dedicated test file. Add tests/dashboard/test_health.py with tests for:

  • GET /health returns valid HealthStatus JSON
  • GET /sovereignty returns SovereigntyReport with expected fields
  • Ollama health cache respects 30-second TTL (_OLLAMA_CACHE_TTL)

Use FastAPI TestClient with mock Ollama responses.

Files to change: 1 new file tests/dashboard/test_health.py

**Type:** Test coverage **File:** `src/dashboard/routes/health.py` Health endpoints have no dedicated test file. Add `tests/dashboard/test_health.py` with tests for: - `GET /health` returns valid `HealthStatus` JSON - `GET /sovereignty` returns `SovereigntyReport` with expected fields - Ollama health cache respects 30-second TTL (`_OLLAMA_CACHE_TTL`) Use FastAPI `TestClient` with mock Ollama responses. **Files to change:** 1 new file `tests/dashboard/test_health.py`
kimi was assigned by Timmy 2026-03-21 19:16:47 +00:00
kimi added this to the Code Hygiene milestone 2026-03-21 20:25:03 +00:00
claude added the consolidation label 2026-03-23 13:51:45 +00:00
Collaborator

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.
kimi was unassigned by Timmy 2026-03-24 01:53:42 +00:00
Timmy self-assigned this 2026-03-24 01:53:42 +00:00
Author
Owner

Taking this one directly — Kimi is overloaded. Will add unit tests for health.py.

Taking this one directly — Kimi is overloaded. Will add unit tests for health.py.
Author
Owner

Closing: tests/dashboard/test_health.py already exists with comprehensive coverage (499 lines, 33 tests covering all endpoints, helpers, caching, and graceful degradation). This issue has been fulfilled.

Closing: tests/dashboard/test_health.py already exists with comprehensive coverage (499 lines, 33 tests covering all endpoints, helpers, caching, and graceful degradation). This issue has been fulfilled.
Timmy closed this issue 2026-03-24 01:54:33 +00:00
Sign in to join this conversation.
No Label consolidation
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#770