blackbull.testing.grpc¶
blackbull.testing.grpc
¶
Loopback gRPC test server.
Status lives in trailers, so an in-process ASGI transport that loses trailers cannot establish gRPC completion. This helper does not provide a general gRPC client.
GrpcReply
dataclass
¶
One gRPC call's reply, judged as a gRPC client must (PROTOCOL-HTTP2.md).
GrpcTestServer
¶
Serve app on an ephemeral h2c port and call its gRPC methods.
async with only: the server shares the test's event loop, as it
shares the process loop in production.
unary(method, request=b'', *, metadata=None, timeout=5.0)
async
¶
Call method with one request message and read the reply.
The length-prefixed framing is applied for you: pass the message bytes your servicer expects to receive, not an encoded frame.