Skip to content

test: add offline tests for the JSON-LD parsers in download.py - #118

Open
Partha-Shankar wants to merge 1 commit into
dbpedia:mainfrom
Partha-Shankar:test/jsonld-parsers
Open

Partha-Shankar wants to merge 1 commit into
dbpedia:mainfrom
Partha-Shankar:test/jsonld-parsers

Conversation

@Partha-Shankar

Copy link
Copy Markdown

Pull Request

Description

Adds offline unit tests for the two JSON-LD parsers in databusclient/api/download.py that no test reached so far:

  • _get_file_download_urls_from_artifact_jsonld: returns the file of Part nodes only, in order; skips Part nodes whose file is missing or not a string; returns [] when there is no @graph.
  • _get_databus_artifacts_of_group: keeps artifact URIs and drops version URIs; accepts a single object as well as a list; skips entries without an @id; returns [] when databus:hasArtifact is missing; raises ValueError for an unexpected type.

Tests only (new file tests/test_download_jsonld_parsers.py), no source change, in the same style as #106. With these tests both functions are fully covered.

Related Issues
None.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • Housekeeping

Checklist:

  • My code follows the ruff code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (test names describe each case)
  • I have made corresponding changes to the documentation (if applicable) (not applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
    • pytest - all tests passed (286 passed, 3 skipped; Windows, Python 3.11, installed with pip instead of Poetry)
    • ruff check - no linting errors (ruff 0.5.7)

Cover _get_file_download_urls_from_artifact_jsonld and _get_databus_artifacts_of_group: Part-only file extraction, skipped malformed nodes, single vs list artifacts, version URIs dropped, and the ValueError for an unexpected type.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64827dd4-7d60-44e4-a144-fcd38f92a589
Commits

Reviewing files that changed from the base of the PR and between b35bd2c and 938c083.

Files selected for processing: 1

  • tests/test_download_jsonld_parsers.py
  • 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.

Share

This branch has not been deployed

No deployments
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