Fix duplicated-code quality gate and document custom headers - #147
Merged
Merged
Conversation
SonarCloud's quality gate failed PR #146 on new-code duplication (24.6%, threshold 3%), isolated to tests/test_folio_client.py (32% new-code duplication). Extract shared helpers for the mock httpx client setup and the paginated folio_get fake, reused across all 13 tests in TestCustomHeaders.
Add usage examples for the per-request headers kwarg added to the folio_* methods, using the mod-custom-fields x-okapi-module-id requirement as the motivating example.
|
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.



Summary
TestCustomHeaders(tests/test_folio_client.py), scoped to the new code only.headerskwarg added in PR Support custom HTTP headers on folio_* requests #146 in the README and the quickstart docs, using themod-custom-fields/x-okapi-module-iduse case as the motivating example.Test plan
uv run python -m pytest tests/ -q— 284 passeduv run ruff check tests/test_folio_client.py— no new issues in the refactored rangeuv run sphinx-build -b html docs docs/_build/html_check -q— docs build clean