Skip to content

test: cover ErrorFormatter classify, transport seam, and path/session edges#40

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-176d
Closed

test: cover ErrorFormatter classify, transport seam, and path/session edges#40
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-176d

Conversation

@cursor

@cursor cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds regression tests for modules extracted in the Jul 16 scraper refactor (c7f46b8). These paths handle network error classification, download progress payloads, transport seam wiring, redirect hardening, and path-builder edge cases — all high-blast-radius download flows with no dedicated coverage on main.

Risky behavior now covered

  • ErrorFormatter.classify — connection, timeout, rate-limited (429 with retry delay), access (403/404), generic HTTP, redirect loops, and unknown errors
  • DownloadTask — frozen 7-field progress schema used by workers/GUI signals
  • LiveBoardApisafe_get wiring for thread/catalog fetch and streaming range requests (default download timeout)
  • safe_get redirect handling — redirect-loop cap (TooManyRedirects) and missing Location header fallback
  • PathBuilder / limit_folder_length — catalog naming, empty-board fallback, truncation with trailing-separator strip

Changed files

File Reason
tests/test_error_format.py New — ErrorFormatter classification categories
tests/test_signals.py New — DownloadTask schema/immutability
tests/test_transport_api.py New — LiveBoardApi → safe_get contract
tests/test_session.py Redirect loop + missing Location header
tests/test_paths.py limit_folder_length + catalog/empty-board naming

Why these tests materially reduce regression risk

The Jul 16 refactor moved error handling, retry policy, chunking, and transport behind new seams. Without tests, a rename or signature drift in ErrorFormatter or LiveBoardApi could silently break user-facing error messages or bypass redirect allowlisting. These tests lock the contracts the GUI and workers depend on.

Testing performed

  • uv run pytest tests/ -q --ignore=tests/test_gui.py97 passed
  • uv run ruff check .
  • Manual run on macOS / Apple Silicon

Safety notes

Test-only change; no production behavior modified.

Screenshots

N/A — no UI changes.

Open in Web View Automation 

Add regression tests for modules extracted in the Jul 16 scraper refactor:
ErrorFormatter classification, DownloadTask schema, LiveBoardApi safe_get
wiring, redirect-loop/missing-Location session handling, and PathBuilder
catalog/empty-board naming plus limit_folder_length truncation.

Co-authored-by: ringlet_fires5b <[email protected]>
@RazorBackRoar

Copy link
Copy Markdown
Owner

Closing as superseded cleanup.

main already contains the needed CI/docs/test fixes. This was an automated draft autofix PR and is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants