Serve WireMock stubs as a mock with respx.
Project description
wiremock-mock
Serve WireMock stubs as a mock with respx.
Requires Python 3.12+.
Installation
uv pip install wiremock-mock
Or with pip:
pip install wiremock-mock
Usage
"""Example usage of wiremock-mock."""
from http import HTTPStatus
from typing import Any
import httpx
import respx
from wiremock_mock import add_wiremock_to_respx
stubs: dict[str, Any] = {
"mappings": [
{
"request": {"method": "GET", "urlPath": "/v1/pages"},
"response": {
"status": 200,
"jsonBody": {"object": "list", "results": []},
},
},
],
}
with respx.mock(
base_url="http://notion-mock.test", assert_all_called=False
) as m:
add_wiremock_to_respx(
mock_obj=m, stubs=stubs, base_url="http://notion-mock.test"
)
response = httpx.get(url="http://notion-mock.test/v1/pages")
assert response.status_code == HTTPStatus.OK # noqa: S101
This lets you use existing WireMock stub files (e.g. from the WireMock Admin API import format) without running WireMock in Docker. All HTTP traffic is mocked at the httpx level via respx. To load stubs from a JSON file, use json.loads(path.read_text()).
Supported stub features
Request matching: method, urlPath (exact), urlPathPattern (regex)
Query parameters: queryParameters with equalTo
Response: status, headers, jsonBody, body
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wiremock_mock-2026.3.2.tar.gz.
File metadata
- Download URL: wiremock_mock-2026.3.2.tar.gz
- Upload date:
- Size: 110.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90884e7afe66a71ecafd31a51d09a74910c0b5181cbc9aa9cba9c2e035dfc31d
|
|
| MD5 |
a4168e0536b7baa18ad4d9b8be141547
|
|
| BLAKE2b-256 |
bb213aedb14151b0d89a434604ea5c2ddd0ee20fcbc1fd68eba6b81718e92ca2
|
Provenance
The following attestation bundles were made for wiremock_mock-2026.3.2.tar.gz:
Publisher:
release.yml on adamtheturtle/wiremock-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wiremock_mock-2026.3.2.tar.gz -
Subject digest:
90884e7afe66a71ecafd31a51d09a74910c0b5181cbc9aa9cba9c2e035dfc31d - Sigstore transparency entry: 1008485690
- Sigstore integration time:
-
Permalink:
adamtheturtle/wiremock-mock@13d37203f088652d6ce45a6033ccc64255c9f160 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d37203f088652d6ce45a6033ccc64255c9f160 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file wiremock_mock-2026.3.2-py3-none-any.whl.
File metadata
- Download URL: wiremock_mock-2026.3.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
532e5f9cde58c020d9ca34017125e99947afecb3c69cb151ce3d27b364038aec
|
|
| MD5 |
989213a629ae04ee2d2b0eda1b767d28
|
|
| BLAKE2b-256 |
72068bbf5fb660e5df2a37cb7064cc477b762b33ce5fd359e60ecb3ebb789140
|
Provenance
The following attestation bundles were made for wiremock_mock-2026.3.2-py3-none-any.whl:
Publisher:
release.yml on adamtheturtle/wiremock-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wiremock_mock-2026.3.2-py3-none-any.whl -
Subject digest:
532e5f9cde58c020d9ca34017125e99947afecb3c69cb151ce3d27b364038aec - Sigstore transparency entry: 1008485694
- Sigstore integration time:
-
Permalink:
adamtheturtle/wiremock-mock@13d37203f088652d6ce45a6033ccc64255c9f160 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d37203f088652d6ce45a6033ccc64255c9f160 -
Trigger Event:
workflow_dispatch
-
Statement type: