Skip to main content

Module test_utils

Module test_utils 

Source
Available on crate feature test-utils only.
Expand description

HTTP client doubles for tests of code that sends through an HttpClientExt.

Structs§

CapturedHttpRequest
Request data captured by RecordingHttpClient.
HttpErrorStreamingClient
An HttpClientExt implementation whose send_streaming fails immediately with a non-success HTTP status and response body.
MockStreamingClient
A mock HTTP client that returns pre-built SSE bytes from send_streaming.
NonSuccessStreamingClient
An HttpClientExt whose send_streaming hands a non-success reply back as an Ok response — the fourth non-success cell: a custom transport that does not reject on status, so the driver must.
RecordingHttpClient
An HttpClientExt implementation that records unary requests and returns a fixed response.
SequencedHttpClient
An HttpClientExt implementation that records requests and returns one scripted response per request. A streamed request’s reply body arrives as one chunk.
SequencedStreamingHttpClient
An HttpClientExt implementation that returns one scripted stream of byte chunks from send_streaming.

Enums§

MockHttpResponse
Response scripted for RecordingHttpClient.