orcid-mock-testing
Test helpers for orcid-mock, an ephemeral mock of the Open Researcher and Contributor ID (ORCID) service:
a client for its admin API, a Testcontainers module, and a pytest plugin.
The main README has the guide, copy-pasteable examples, and the rules for ORCID_MOCK_URL, ORCID_MOCK_IMAGE, and ORCID_MOCK_ADMIN_TOKEN.
uv add --dev orcid-mock-testing
Python 3.11 or later, and a Docker daemon on the machine that runs the tests (unless ORCID_MOCK_URL names a running instance).
The import name is orcid_mock.
| Import | Provides |
|---|---|
orcid_mock.client.OrcidMockClient(base_url, *, admin_token=None) |
health, reset, users, user, create_user, put_user, delete_user, put_client, advance_clock, and sign_in, the headless sign-in that returns the token response |
orcid_mock.container.OrcidMockContainer(image=None, *, users=None, admin_token=None) |
a testcontainers DockerContainer that publishes the mock on a port chosen up front; with_users, with_admin_token, and after start() a base_url and a ready client |
orcid_mock.pytest_plugin |
registered with pytest on install: the session-scoped orcid_mock fixture, the function-scoped orcid_mock_reset fixture, and the options --orcid-mock-image and --orcid-mock-users |
The default image is ghcr.io/nemarorg/orcid-mock:<this package's version>, because the helpers are released in lockstep with the server.
A mock started with an admin token (ADMIN_TOKEN or --admin-token-file) refuses an admin call without it.
The client and the container take it from admin_token, or else from ORCID_MOCK_ADMIN_TOKEN, and send it as Authorization: Bearer <token> on the admin calls only;
a container started with one gets it as ADMIN_TOKEN.
An empty value counts as not given in every entry point (admin_token: "" and with_admin_token("") included), so the variable still applies; with neither, nothing changes.
A token with a character that is not visible American Standard Code for Information Interchange (ASCII), such as a space or a trailing newline, raises before any request, with a message that names ORCID_MOCK_ADMIN_TOKEN and never the value.
With ORCID_MOCK_URL set, the setup makes one admin call after the health check, so a missing or wrong token fails there and not in the first test.
A refused token raises OrcidMockError with status 401 and a message that names ORCID_MOCK_ADMIN_TOKEN, never the token.
Metadata
Release files for orcid-mock-testing 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orcid_mock_testing-1.1.0.tar.gz | 11.8 kB | Without provenance | Details for orcid_mock_testing-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orcid_mock_testing-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for orcid_mock_testing-1.1.0-py3-none-any.whl |
Total release size: 26.2 kB
Release files / orcid_mock_testing-1.1.0.tar.gz
| Download URL | orcid_mock_testing-1.1.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c12433019e4a4997dc28cdd4c64eaffe6f50b57623edf97afbe1d819fb41a82
|
|
BLAKE2b-256 checksum How to use checksums |
a209db1c596da3ced2343970fe3e385e9dc0e6878be8c1d6416b0e3439a28726
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / orcid_mock_testing-1.1.0-py3-none-any.whl
| Download URL | orcid_mock_testing-1.1.0-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5348381702e03ab13aa28d0f6bb6457182bad255465499eee52d2199ea579c7
|
|
BLAKE2b-256 checksum How to use checksums |
95a5ec96d1e91b61381baa50fb64f2fdf865845984d0f62dcd6ff261f6ec1d3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for orcid-mock-testing 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.