API Reference¶
Package for serving WireMock stubs as a mock with respx.
- wiremock_mock.add_wiremock_to_respx(*, mock_obj: MockRouter | Router, stubs: dict[str, Any], base_url: str) None¶
Add mock routes from WireMock stubs to a respx mock/router.
Supports request matching by: - method -
urlPath(exact) orurlPathPattern(regex) -queryParameterswithequalToResponse uses status, headers, and
jsonBodyfrom each stub.- Parameters:
mock_obj – The respx MockRouter or Router to add routes to.
stubs – WireMock stubs dict with
mappingsarray (e.g. fromjson.loads(path.read_text())).base_url – Base URL for all routes. Must match
respx.mock().