Skip to main content
repost_client.testing ships inside repost-client with no extra dependencies. It drives the real generated method tree, validation, serialization, retry loop, cancellation, and observers through an injected ScriptedTransport that cannot open a network connection.

Deterministic client harness

deterministic_client_options() wires a scripted transport, recording observer, manual clock, fixed generators, fixed idempotency key, and zero retry entropy into one ClientOptions value:
Recorded requests retain the URL, serialized body, attempt number, idempotency key, and timeouts. The testing transport removes Authorization before storage.

Script responses and failures

ScriptedTransport consumes one FIFO script entry per attempt:
Use enqueue_pending() when a test must settle an attempt after cancellation, a deadline, or another event. ControlledResponse.respond(), .fail(), and .cancel() settle it exactly once. Script exhaustion fails as a custom-transport defect instead of falling through to the default network transport.

Drive retry timing

ManualScheduler pauses a nonzero retry delay until the test advances its ManualClock. Run the synchronous send on a worker thread, wait for the pending sleep, then advance time from the test thread:
For exact sequences, use sequence_entropy(), sequence_generators(), or sequence_idempotency_keys(). Fixed and failing variants cover stable values and pre-network failure paths.

Assert lifecycle events

RecordingObserver.events is an immutable snapshot. await_next() waits on a condition for the next event, and await_quiescence() waits until the runtime has dispatched every queued event:
Use the scripted transport for fast application tests. The SDK’s own native pytest suite separately exercises the generated client through the default real HTTP transport and a local server.

Continue

Observability

See the diagnostics and lifecycle events available in production.

Reliability

Choose the delivery states and error codes to exercise.

Frameworks

Own and close one client in your application lifecycle.