[loop-generated] [bug] Tower route /tower missing tests #614

Closed
opened 2026-03-20 20:11:23 +00:00 by Timmy · 2 comments
Owner

PR #612 added src/dashboard/routes/tower.py with GET /tower and WS /tower/ws endpoints but included zero tests.

Needed:

  • Test GET /tower returns 200 with expected HTML structure
  • Test _spark_snapshot() returns correct dict shape
  • Test WebSocket /tower/ws connects and sends initial snapshot

Files:

  • src/dashboard/routes/tower.py
  • tests/dashboard/test_tower.py (new)

Acceptance: at least 3 tests covering the route, snapshot function, and websocket.

PR #612 added `src/dashboard/routes/tower.py` with GET /tower and WS /tower/ws endpoints but included zero tests. Needed: - Test GET /tower returns 200 with expected HTML structure - Test _spark_snapshot() returns correct dict shape - Test WebSocket /tower/ws connects and sends initial snapshot Files: - `src/dashboard/routes/tower.py` - `tests/dashboard/test_tower.py` (new) Acceptance: at least 3 tests covering the route, snapshot function, and websocket.
kimi was assigned by Timmy 2026-03-20 20:11:36 +00:00
Author
Owner

Instructions for Kimi

Create tests/dashboard/test_tower.py with tests for the Tower dashboard route.

Files to read:

  • src/dashboard/routes/tower.py — the route under test

Tests needed:

  1. test_tower_page_returns_200 — GET /tower returns 200 with HTML containing "TOWER"
  2. test_spark_snapshot_shape — Call _spark_snapshot() directly, verify it returns dict with keys: type, status, events, predictions, advisories
  3. test_tower_ws_connects — WebSocket /tower/ws accepts connection and sends initial JSON snapshot

Patterns to follow:

Look at tests/dashboard/test_dashboard.py for how to set up the test client with httpx.ASGITransport. Use @pytest.fixture for the async client.

Verification:

tox -e unit -- tests/dashboard/test_tower.py -v
## Instructions for Kimi Create `tests/dashboard/test_tower.py` with tests for the Tower dashboard route. ### Files to read: - `src/dashboard/routes/tower.py` — the route under test ### Tests needed: 1. **test_tower_page_returns_200** — GET /tower returns 200 with HTML containing "TOWER" 2. **test_spark_snapshot_shape** — Call `_spark_snapshot()` directly, verify it returns dict with keys: type, status, events, predictions, advisories 3. **test_tower_ws_connects** — WebSocket /tower/ws accepts connection and sends initial JSON snapshot ### Patterns to follow: Look at `tests/dashboard/test_dashboard.py` for how to set up the test client with `httpx.ASGITransport`. Use `@pytest.fixture` for the async client. ### Verification: ```bash tox -e unit -- tests/dashboard/test_tower.py -v ```
Timmy closed this issue 2026-03-20 20:22:14 +00:00
Author
Owner

Kimi Instructions

Task: Add comprehensive tests for the Tower route.

Files to modify:

  • tests/dashboard/test_tower.py (create or extend)

Files to reference (read-only):

  • src/dashboard/routes/tower.py — the route being tested

What to test:

  1. GET /tower returns 200 with valid HTML
  2. Test that the template context contains expected data
  3. Test error handling paths if any exist
  4. Use the existing test patterns in tests/dashboard/ for fixtures and client setup

Verify: tox -e unit must pass with the new tests included.

## Kimi Instructions **Task**: Add comprehensive tests for the Tower route. **Files to modify**: - `tests/dashboard/test_tower.py` (create or extend) **Files to reference** (read-only): - `src/dashboard/routes/tower.py` — the route being tested **What to test**: 1. GET /tower returns 200 with valid HTML 2. Test that the template context contains expected data 3. Test error handling paths if any exist 4. Use the existing test patterns in `tests/dashboard/` for fixtures and client setup **Verify**: `tox -e unit` must pass with the new tests included.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#614