Skip to content

Add recorded-cassette contract tests for live network clients#27

Merged
ChelseaKR merged 2 commits into
mainfrom
roadmap/live-path-contract-cassette-tests-for-ko
Jul 12, 2026
Merged

Add recorded-cassette contract tests for live network clients#27
ChelseaKR merged 2 commits into
mainfrom
roadmap/live-path-contract-cassette-tests-for-ko

Conversation

@ChelseaKR

Copy link
Copy Markdown
Owner

KosyncClient, OpenLibraryClient, and BookwyrmClient were pragma: no cover,
verified only via manual integration. Add tests/test_live_clients_cassettes.py,
which stubs requests.get with fake Response objects loaded from recorded
JSON bodies under tests/cassettes/ (no VCR dependency), covering request
building, header/URL construction, the Kosync 404 branch, and the
ResponseCache put/get path against real response shapes. Drop the now-
redundant pragma: no cover markers on all three client classes.

Fixes a blocking prerequisite along the way: ingest/kosync.py and
recommender/catalogs.py used Python-2 except A, B: syntax, which is a
SyntaxError under Python 3 and prevented both modules from importing.
Changed to parenthesized exception tuples.

Marks the "Live-path contract tests" item done in docs/ROADMAP-FUTURE.md.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com


Backfill PR for a completed roadmap item (roadmap/live-path-contract-cassette-tests-for-ko, 1 commit(s) over main). Part of the portfolio roadmap batch.

KosyncClient, OpenLibraryClient, and BookwyrmClient were pragma: no cover,
verified only via manual integration. Add tests/test_live_clients_cassettes.py,
which stubs requests.get with fake Response objects loaded from recorded
JSON bodies under tests/cassettes/ (no VCR dependency), covering request
building, header/URL construction, the Kosync 404 branch, and the
ResponseCache put/get path against real response shapes. Drop the now-
redundant pragma: no cover markers on all three client classes.

Fixes a blocking prerequisite along the way: ingest/kosync.py and
recommender/catalogs.py used Python-2 `except A, B:` syntax, which is a
SyntaxError under Python 3 and prevented both modules from importing.
Changed to parenthesized exception tuples.

Marks the "Live-path contract tests" item done in docs/ROADMAP-FUTURE.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ChelseaKR added a commit that referenced this pull request Jul 9, 2026
The fetch-etiquette section claimed the whole policy was 'enforced by
etiquette_headers + ResponseCache'. True for User-Agent, public-metadata-
only, caching, and the host allowlist — but robots.txt honouring and
429/5xx backoff are not implemented in any client yet (the live clients
are pragma: no cover network paths; backoff/robots are planned with the
FIX-01 candidate pipeline + PR #27 cassettes). The compliance doc now
distinguishes enforced-in-code rules from committed-policy-pending-code,
matching the repo's no-overclaiming posture. docs/ethical-book-data-
sources.md regenerated from to_markdown(); coverage.xml regenerated.

make verify green: 210 tests, 96.67% branch coverage, pa11y 0, eval green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ChelseaKR added a commit that referenced this pull request Jul 10, 2026
The fetch-etiquette section claimed the whole policy was 'enforced by
etiquette_headers + ResponseCache'. True for User-Agent, public-metadata-
only, caching, and the host allowlist — but robots.txt honouring and
429/5xx backoff are not implemented in any client yet (the live clients
are pragma: no cover network paths; backoff/robots are planned with the
FIX-01 candidate pipeline + PR #27 cassettes). The compliance doc now
distinguishes enforced-in-code rules from committed-policy-pending-code,
matching the repo's no-overclaiming posture. docs/ethical-book-data-
sources.md regenerated from to_markdown(); coverage.xml regenerated.

make verify green: 210 tests, 96.67% branch coverage, pa11y 0, eval green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ChelseaKR
ChelseaKR merged commit 3fcd996 into main Jul 12, 2026
5 checks passed
@ChelseaKR
ChelseaKR deleted the roadmap/live-path-contract-cassette-tests-for-ko branch July 12, 2026 07:50
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.

1 participant