Add recorded-cassette contract tests for live network clients#27
Merged
ChelseaKR merged 2 commits intoJul 12, 2026
Merged
Conversation
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>
# Conflicts: # docs/audits/coverage.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aSyntaxError 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) overmain). Part of the portfolio roadmap batch.