Repository navigation
test: add offline tests for download checksum helpers - #106
TejasKumat8 wants to merge 1 commit into
Conversation
Cover _extract_checksum_from_node, _extract_checksums_from_jsonld, _resolve_checksums_for_urls and get_expected_checksum, which back --validate-checksum and had no tests. The JSON-LD fixtures follow the real Part node shape (sha256sum, file, @id) and the network is mocked.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Checksum extraction and JSON-LD mappings tests/test_download_checksums.py |
Adds fixtures and tests for accepted checksum keys and value shapes, invalid values, and mappings from JSON-LD metadata to file URLs and node IDs. |
URL-based checksum resolution tests/test_download_checksums.py |
Tests version fetching, URL filtering, HTTP-to-HTTPS metadata matching, missing checksums, and fetch-error handling. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Other
Possibly related PRs
- dbpedia/databus-python-client#100: Adds account downloads and forwards checksum validation options to discovered groups.
- dbpedia/databus-python-client#99: Changes custom-header handling for
get_expected_checksumandfetch_databus_jsonld.
Merge Risk: 
Minimal · up to 2ee1f
-
The offline checksum-helper tests present no identified merge-blocking risk. Merge after normal checks pass.
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passedFull details: Description check
-
Explanation
The description explains the test scope, mocked network behavior, related issue context, and reported test results. However, the Type of change section is truncated, several checklist items are corrupted or incomplete, and the lint command is unclear.
Resolution
Restore the complete description template. Correct the Type of change options and checklist text. State the exact lint command and confirm its result. Keep the test and validation details already provided.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Hi! This adds tests for the checksum helpers in
api/download.pythat--validate-checksumrelies on. They didn't have tests yet:_extract_checksum_from_node,_extract_checksums_from_jsonld,_resolve_checksums_for_urlsandget_expected_checksum.The new file is
tests/test_download_checksums.py, with 35 tests. The JSON-LD in the tests follows the shape of realPartnodes on databus.dbpedia.org (sha256sum,file,@id).fetch_databus_jsonldis mocked, so nothing hits the network.As a quick sanity check, I temporarily broke the SHA-256 regex locally, and 19 of the new tests failed while the existing suite still passed.
No source changes, so I didn't bump the version. Happy to adjust anything if useful.
Related Issues
None directly. Addresses the low test coverage mentioned in the README.
Type of change
Checklist:
hard-to-underst
(if applicable)
that my feature
changes
Summary by CodeRabbit