Skip to content

Document _request and add a Dataverse success-path test - #38

Merged
timlichtenberg merged 1 commit into
mainfrom
tl/dataverse-request-followup
Aug 31, 2026
Merged

timlichtenberg merged 1 commit into
mainfrom
tl/dataverse-request-followup

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

What this does

Documents DataverseClient._request and adds a unit test for its success path.

Why

The 2xx-bad-body fix rewrote the _request return contract but left the method undocumented, and the unit tests covered only the empty and malformed body cases, not the branch that decodes and returns a valid body. This closes both gaps.

Changes

  • Add a docstring to _request covering its parameters, the {} return for an empty 2xx body, and the DataverseError conditions (transport failure, status 400 or higher, non-JSON or non-object body).
  • Add a unit test that a 2xx response with a JSON-object body decodes and returns as-is.

Testing

pytest tests/test_mirror.py: unit tests pass, ruff clean.

_request now carries the parameters, return value, and error
conditions of the Dataverse native-API contract every public method
relies on.

A new unit test confirms _request returns a non-empty 2xx JSON-object
body unchanged, the one behavior no existing test observes directly
since every public method discards part of the body.
@timlichtenberg
timlichtenberg merged commit 58cb7be into main Aug 31, 2026
7 checks passed
@timlichtenberg
timlichtenberg deleted the tl/dataverse-request-followup branch August 31, 2026 20:24
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