ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Simulate outbound HTTP attempts within a fixture scope.

Each scope records its own request history for assertions.

Class FakeContext Record attempts in this context and reject every unconfigured request.
Class FakeResponse Store immutable metadata and raw body for one simulated response.
Async Function _body_chunks Yield raw bytes through the same read path as network responses.
Function fake_response Build an immutable fixture from raw bytes, text or a JSON value.
Type Alias Fixtures Associate a method and absolute URL with a reusable outcome or ordered outcomes.
Type Alias HeaderInput Accept headers as a mapping or an ordered sequence of name and value pairs.
Type Alias Outcome Represent a response or a client exception for one simulated attempt.
async def _body_chunks(body: bytes) -> AsyncGenerator[bytes]: (source)

Yield raw bytes through the same read path as network responses.

Parameters
body:bytesPayload supplied for this response or request.
Yields
bytesOne raw body chunk when the payload contains bytes.
def fake_response(body: object = b'', *, status: int = 200, headers: HeaderInput = ()) -> FakeResponse: (source)

Build an immutable fixture from raw bytes, text or a JSON value.

Parameters
body:objectRaw bytes, text or JSON-compatible fixture payload.
status:intHTTP response status code.
headers:HeaderInputHeader fields in request or wire order.
Returns
FakeResponseImmutable fixture consumed by the test transport.

Associate a method and absolute URL with a reusable outcome or ordered outcomes.

Value
Mapping[tuple[str, str], Outcome | Sequence[Outcome]]

Accept headers as a mapping or an ordered sequence of name and value pairs.

Value
Mapping[str, str] | Sequence[tuple[str, str]]

Represent a response or a client exception for one simulated attempt.

Value
FakeResponse | HttpClientException