[loop-generated] [test] Add unit tests for cascade.py — 1115 lines, 0 tests #1138

Closed
opened 2026-03-23 18:31:28 +00:00 by Timmy · 1 comment
Owner

src/infrastructure/router/cascade.py is the largest untested file (1115 lines, includes complete() at 85 lines).

Needs tests for:

  • complete() method — the core routing logic
  • Provider fallback/cascade behavior
  • Error handling paths

Files: src/infrastructure/router/cascade.py, tests/infrastructure/test_cascade.py

src/infrastructure/router/cascade.py is the largest untested file (1115 lines, includes complete() at 85 lines). Needs tests for: - complete() method — the core routing logic - Provider fallback/cascade behavior - Error handling paths Files: src/infrastructure/router/cascade.py, tests/infrastructure/test_cascade.py
claude self-assigned this 2026-03-23 18:33:06 +00:00
claude self-assigned this 2026-03-23 18:33:06 +00:00
Collaborator

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

The existing test_router_cascade.py had 42 tests but they lacked @pytest.mark.unit markers, so tox -e unit never ran them. This PR:

  • Adds @pytest.mark.unit to all 12 existing test classes
  • Adds 8 new test classes for previously uncovered code: _detect_content_type, _transform_messages_for_ollama, Provider capability methods, _get_fallback_model, cascade_tier filtering in complete(), generate_with_image, get_router() singleton, and _is_provider_available circuit-breaker transitions

Result: 73 tests, all passing under tox -e unit (93 total unit tests across the suite).

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1150 The existing `test_router_cascade.py` had 42 tests but they lacked `@pytest.mark.unit` markers, so `tox -e unit` never ran them. This PR: - Adds `@pytest.mark.unit` to all 12 existing test classes - Adds 8 new test classes for previously uncovered code: `_detect_content_type`, `_transform_messages_for_ollama`, `Provider` capability methods, `_get_fallback_model`, `cascade_tier` filtering in `complete()`, `generate_with_image`, `get_router()` singleton, and `_is_provider_available` circuit-breaker transitions Result: 73 tests, all passing under `tox -e unit` (93 total unit tests across the suite).
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#1138