Test HTTP/2 support.
Class | FrameFactory | A class containing lots of helper methods and state to build frames. This allows test cases to easily build correct HTTP/2 frames to feed to hyper-h2. |
Class | FrameBuffer | A test object that converts data received from Twisted's HTTP/2 stack and turns it into a sequence of hyperframe frame objects. |
Function | buildRequestFrames | No summary |
Function | buildRequestBytes | Provides the byte sequence for a collection of HTTP/2 frames representing the provided request. |
Function | framesFromBytes | Given a sequence of bytes, decodes them into frames. |
Class | ChunkedHTTPHandler | A HTTP request object that writes chunks of data back to the network based on the URL. |
Class | ConsumerDummyHandler | No summary |
Class | AbortingConsumerDummyHandler | No summary |
Class | DummyProducerHandler | An HTTP request handler that registers a dummy producer to serve the body. |
Class | NotifyingRequestFactory | No summary |
Class | HTTP2TestHelpers | A superclass that contains no tests but provides test helpers for HTTP/2 tests. |
Class | HTTP2ServerTests | No class docstring; 33/33 methods documented |
Class | H2FlowControlTests | Tests that ensure that we handle HTTP/2 flow control limits appropriately. |
Class | HTTP2TransportChecking | No class docstring; 4/4 methods documented |
Class | HTTP2SchedulingTests | The H2Connection object schedules certain events (mostly its data sending loop) using callbacks from the reactor. These tests validate that the calls are scheduled correctly. |
Class | HTTP2TimeoutTests | The H2Connection
object times out idle connections. |
Provides a sequence of HTTP/2 frames that encode a single HTTP request.
This should be used when you want to control the serialization yourself,
e.g. because you want to interleave other frames with these. If that's not
necessary, prefer buildRequestBytes
.
Parameters | headers | The HTTP/2 headers to send. (type: list
of tuple
of bytes ) |
data | The HTTP data to send. Each list entry will be sent in its own frame. (type: list
of bytes ) | |
frameFactory | The FrameFactory
that will be used to construct the frames. (type: FrameFactory ) | |
streamID | The ID of the stream on which to send the request. (type: int ) |
Provides the byte sequence for a collection of HTTP/2 frames representing the provided request.
Parameters | headers | The HTTP/2 headers to send. (type: list
of tuple
of bytes ) |
data | The HTTP data to send. Each list entry will be sent in its own frame. (type: list
of bytes ) | |
frameFactory | The FrameFactory
that will be used to construct the frames. (type: FrameFactory ) | |
streamID | The ID of the stream on which to send the request. (type: int ) |
Given a sequence of bytes, decodes them into frames.
Note that this method should almost always be called only once, before making some assertions. This is because decoding HTTP/2 frames is extremely stateful, and this function doesn't preserve any of that state between calls.
Parameters | data | The serialized HTTP/2 frames. (type: bytes ) |
Returns | A list of HTTP/2 frames. (type: list
of hyperframe.frame.Frame subclasses.) |