Skip to content

test: add local dummy Databus HTTP server for offline download tests - #120

Open
saicharan13245-ship-it wants to merge 1 commit into
dbpedia:mainfrom
saicharan13245-ship-it:test-offline-databus-mock
Open

saicharan13245-ship-it wants to merge 1 commit into
dbpedia:mainfrom
saicharan13245-ship-it:test-offline-databus-mock

Conversation

@saicharan13245-ship-it

@saicharan13245-ship-it saicharan13245-ship-it commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Adds a lightweight, stdlib-only local dummy Databus HTTP server fixture (dummy_databus_server) in tests/test_download_offline_server.py to support offline end-to-end download testing without hitting databus.dbpedia.org.

  • Simulates Databus collection (GET), SPARQL (POST /sparql), JSON-LD metadata, and file (HEAD/GET) endpoints locally on 127.0.0.1.
  • Adds test_download_collection_offline and test_download_sparql_query_offline without modifying existing conftest.py stubs.

Related Issues
Addresses the "Advanced" offline testing section of Issue #20.

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
  • I have made corresponding changes to the documentation (if 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
    • poetry run pytest - all tests passed
    • poetry run ruff check - no linting errors

Summary by CodeRabbit

  • Tests
    • Added coverage for offline downloads through both collection browsing and direct query workflows.
    • Verified that each workflow produces the expected file and content.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds offline tests for collection-URL and SPARQL-query downloads. The tests use a local threaded HTTP server and verify the downloaded file name, count, and payload.

Changes: Offline download tests

Layer / File(s) Summary
Local server and download assertions
tests/test_download_offline_server.py
A fixture starts a local HTTP server, patches the downloader’s SPARQL wrapper, and ensures server cleanup. Tests verify that collection-URL and SPARQL-query downloads each write one sample.ttl file with the expected payload.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: integer-ctrl

Merge Risk: Minimal · up to 68151

This change adds offline tests for collection and SPARQL downloads using a local server. It does not alter production behavior, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a local dummy Databus HTTP server added for offline download tests. The changeset adds the dummy_databus_server fixture in tests/test_download_offline_server.py and tw…
Description check Passed The description follows the repository template. It has a clear Description that explains the stdlib-only dummy Databus HTTP server fixture and the endpoints it simulates. It links Issue #20 under Rel…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a local dummy Databus HTTP server added for offline download tests. The changeset adds the dummy_databus_server fixture in tests/test_download_offline_server.py and two offline download tests, so the title matches the primary change. It uses the conventional 'test:' prefix and is concise.

Full details: Description check

Explanation

The description follows the repository template. It has a clear Description that explains the stdlib-only dummy Databus HTTP server fixture and the endpoints it simulates. It links Issue #20 under Related Issues and marks Housekeeping under Type of change. The checklist is filled in, and the documentation item is left unchecked, which is acceptable because the change adds tests only.

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.

Share

Recent review info

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: 61ba85e3-9c08-4d41-be89-f3daeac5a5b1
Commits

Reviewing files that changed from the base of the PR and between b35bd2c and 681512a.

Files selected for processing: 1

  • tests/test_download_offline_server.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

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