[loop-generated] [test] Add unit tests for daily_run.py — 435 lines, 0 tests #1186

Closed
opened 2026-03-23 21:47:25 +00:00 by Timmy · 2 comments
Owner

Problem

src/dashboard/routes/daily_run.py is 435 lines with no dedicated test file.

Files

  • src/dashboard/routes/daily_run.py
  • tests/dashboard/test_daily_run.py (new)

Acceptance

  • 10+ test cases covering main handlers
  • tox -e unit green
## Problem `src/dashboard/routes/daily_run.py` is 435 lines with no dedicated test file. ## Files - `src/dashboard/routes/daily_run.py` - `tests/dashboard/test_daily_run.py` (new) ## Acceptance - 10+ test cases covering main handlers - `tox -e unit` green
claude self-assigned this 2026-03-23 21:47:29 +00:00
claude was unassigned by Timmy 2026-03-23 21:47:40 +00:00
kimi was assigned by Timmy 2026-03-23 21:47:40 +00:00
Author
Owner

Kimi: Create tests/dashboard/test_daily_run.py with unit tests for src/dashboard/routes/daily_run.py. Mock external deps (Gitea API, Ollama, Flask app context). Focus on route handlers and error paths. Target 10+ tests. Run tox -e unit to verify.

Kimi: Create `tests/dashboard/test_daily_run.py` with unit tests for `src/dashboard/routes/daily_run.py`. Mock external deps (Gitea API, Ollama, Flask app context). Focus on route handlers and error paths. Target 10+ tests. Run `tox -e unit` to verify.
Collaborator

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1199

Added tests/dashboard/test_daily_run.py with 51 test cases covering all major components:

  • _load_config, _get_token, GiteaClient (headers, URL, availability, pagination)
  • LayerMetrics and DailyRunMetrics trend properties
  • _extract_layer, _load_cycle_data, _fetch_layer_metrics, _get_metrics
  • Both route handlers (/daily-run/metrics JSON API and /daily-run/panel HTML)

All 51 tests pass. tox -e unit remains green (293 passing).

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1199 Added `tests/dashboard/test_daily_run.py` with **51 test cases** covering all major components: - `_load_config`, `_get_token`, `GiteaClient` (headers, URL, availability, pagination) - `LayerMetrics` and `DailyRunMetrics` trend properties - `_extract_layer`, `_load_cycle_data`, `_fetch_layer_metrics`, `_get_metrics` - Both route handlers (`/daily-run/metrics` JSON API and `/daily-run/panel` HTML) All 51 tests pass. `tox -e unit` remains green (293 passing).
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1186