Testing¶
lacme.testing ¶
Test utilities for lacme.
Provides :class:MockACMEServer, an in-process ACME server backed by
:class:httpx.MockTransport for integration testing.
MockACMEServer ¶
In-process mock ACME server for integration tests.
Implements enough of the ACME protocol to support the full
:meth:~lacme.client.Client.issue flow. Does not verify
JWS signatures — focuses on protocol flow testing.
Not thread-safe. Intended for single-threaded or single-async-task test scenarios.
Usage::
server = MockACMEServer()
transport = server.as_transport()
http = httpx.AsyncClient(transport=transport, base_url="https://acme.test")
async with Client(
directory_url="https://acme.test/directory",
http_client=http,
account_key=key,
challenge_handler=handler,
) as client:
bundle = await client.issue(["example.com"])