Skip to content

test: cover ErrorFormatter classify, transport seam, and path edges#39

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

test: cover ErrorFormatter classify, transport seam, and path edges#39
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-882e

Conversation

@cursor

@cursor cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Nightly test-coverage run targeting the Jul 16 scraper refactor (c7f46b8), which extracted ErrorFormatter, LiveBoardApi, DownloadTask, and path helpers but left several new code paths without direct regression tests.

Risky behavior now covered

  • ErrorFormatter.classify — category routing for connection, timeout, rate-limit (429), access (403/404), generic HTTP, redirect loops, and unknown errors
  • LiveBoardApi transport seamsafe_get wiring for thread/catalog fetch and streaming range requests (default download timeout)
  • Redirect hardeningTooManyRedirects on redirect loops; retry when Location header is missing
  • Path builder edgeslimit_folder_length, catalog/empty-board session naming
  • DownloadTask — frozen progress payload schema used by workers

Test files added/updated

  • tests/test_error_format.py (new)
  • tests/test_transport_api.py (new)
  • tests/test_signals.py (new)
  • tests/test_session.py (redirect loop + missing Location)
  • tests/test_paths.py (limit_folder_length + session base names)

Why these tests materially reduce regression risk

The scraper refactor moved error classification and network access behind new seams. Failures there affect every download path (rate-limit backoff, user-facing messages, redirect security). Direct unit tests on the extracted modules catch regressions without standing up a full FourChanScraper or GUI worker.

Testing performed

  • uv run ruff check on touched test files
  • uv run pytest tests/ -q --ignore=tests/test_gui.py97 passed
  • 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.classify categories, LiveBoardApi safe_get wiring,
DownloadTask progress schema, redirect-loop hardening, and path builder
helpers (limit_folder_length, catalog/empty-board session names).

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