Skip to main content

Module mocking

Module mocking 

Source
Expand description

Typed contracts for OpenAPI-derived mock scenarios.

Poolster keeps mock behaviour on an operation’s x-poolster-mock extension. The extension is intentionally small and transport-neutral, so a generated MSW handler, a standalone HTTP fixture, and a hosted mock environment can all make the same request/response decision.

Structs§

MockRequestMatch
Exact request predicates for a mock scenario.
MockResponse
The response emitted when a MockRequestMatch succeeds.
MockScenario
One named mock scenario declared on an API operation.

Functions§

extract_mock_scenarios
Extracts every valid x-poolster-mock scenario from an API.
extract_operation_mock_scenarios
Extracts and validates mock scenarios for one operation.
mock_scenario_matches
Returns whether a scenario applies to one incoming HTTP request.