code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def test_sending_multiple_header_blocks(self,
frame_factory,
hdrs,
request_headers,
end_stream) -> None:
"""
At least three head... |
At least three header blocks can be sent: informational, headers,
trailers.
| test_sending_multiple_header_blocks | python | python-hyper/h2 | tests/test_informational_responses.py | https://github.com/python-hyper/h2/blob/master/tests/test_informational_responses.py | MIT |
def test_send_provisional_response_with_end_stream(self,
frame_factory,
hdrs,
request_headers,
end_s... |
Sending provisional responses with END_STREAM set causes
ProtocolErrors.
| test_send_provisional_response_with_end_stream | python | python-hyper/h2 | tests/test_informational_responses.py | https://github.com/python-hyper/h2/blob/master/tests/test_informational_responses.py | MIT |
def test_reject_sending_out_of_order_headers(self,
frame_factory,
hdrs,
request_headers,
end_stream) -> None:
"""
... |
When sending an informational response after the actual response
headers we consider it a ProtocolError and raise it.
| test_reject_sending_out_of_order_headers | python | python-hyper/h2 | tests/test_informational_responses.py | https://github.com/python-hyper/h2/blob/master/tests/test_informational_responses.py | MIT |
def test_basic_request_response(self, request_headers) -> None:
"""
A request issued by hyper-h2 can be responded to by hyper-h2.
"""
def client():
c = h2.connection.H2Connection()
# Do the handshake. First send the preamble.
c.initiate_connection()
... |
A request issued by hyper-h2 can be responded to by hyper-h2.
| test_basic_request_response | python | python-hyper/h2 | tests/test_interacting_stacks.py | https://github.com/python-hyper/h2/blob/master/tests/test_interacting_stacks.py | MIT |
def test_too_much_data(self, frame_factory, request_headers) -> None:
"""
Remote peers sending data in excess of content-length causes Protocol
Errors.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_facto... |
Remote peers sending data in excess of content-length causes Protocol
Errors.
| test_too_much_data | python | python-hyper/h2 | tests/test_invalid_content_lengths.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_content_lengths.py | MIT |
def test_insufficient_data(self, frame_factory, request_headers) -> None:
"""
Remote peers sending less data than content-length causes Protocol
Errors.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_fact... |
Remote peers sending less data than content-length causes Protocol
Errors.
| test_insufficient_data | python | python-hyper/h2 | tests/test_invalid_content_lengths.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_content_lengths.py | MIT |
def test_insufficient_data_empty_frame(self, frame_factory, request_headers) -> None:
"""
Remote peers sending less data than content-length where the last data
frame is empty causes Protocol Errors.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate... |
Remote peers sending less data than content-length where the last data
frame is empty causes Protocol Errors.
| test_insufficient_data_empty_frame | python | python-hyper/h2 | tests/test_invalid_content_lengths.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_content_lengths.py | MIT |
def test_cannot_send_on_closed_stream(self, request_headers) -> None:
"""
When we've closed a stream locally, we cannot send further data.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, request_headers, end_stream=True)
with pytest... |
When we've closed a stream locally, we cannot send further data.
| test_cannot_send_on_closed_stream | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_missing_preamble_errors(self) -> None:
"""
Server side connections require the preamble.
"""
c = h2.connection.H2Connection(config=self.server_config)
encoded_headers_frame = (
b"\x00\x00\r\x01\x04\x00\x00\x00\x01"
b"A\x88/\x91\xd3]\x05\\\x87\xa7\... |
Server side connections require the preamble.
| test_missing_preamble_errors | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_server_connections_reject_even_streams(self, frame_factory, request_headers) -> None:
"""
Servers do not allow clients to initiate even-numbered streams.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_fa... |
Servers do not allow clients to initiate even-numbered streams.
| test_server_connections_reject_even_streams | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_clients_reject_odd_stream_pushes(self, frame_factory, request_headers) -> None:
"""
Clients do not allow servers to push odd numbered streams.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, request_headers, end_stream=True)
... |
Clients do not allow servers to push odd numbered streams.
| test_clients_reject_odd_stream_pushes | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_can_handle_frames_with_invalid_padding(self, frame_factory, request_headers) -> None:
"""
Frames with invalid padding cause connection teardown.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.pre... |
Frames with invalid padding cause connection teardown.
| test_can_handle_frames_with_invalid_padding | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_receiving_frames_with_insufficent_size(self, frame_factory) -> None:
"""
Frames with not enough data cause connection teardown.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
Frames with not enough data cause connection teardown.
| test_receiving_frames_with_insufficent_size | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_reject_data_on_closed_streams(self, frame_factory, request_headers) -> None:
"""
When a stream is not open to the remote peer, we reject receiving data
frames from them.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
... |
When a stream is not open to the remote peer, we reject receiving data
frames from them.
| test_reject_data_on_closed_streams | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_unexpected_continuation_on_closed_stream(self, frame_factory, request_headers) -> None:
"""
CONTINUATION frames received on closed streams cause connection errors
of type PROTOCOL_ERROR.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_con... |
CONTINUATION frames received on closed streams cause connection errors
of type PROTOCOL_ERROR.
| test_unexpected_continuation_on_closed_stream | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_prevent_continuation_dos(self, frame_factory, request_headers) -> None:
"""
Receiving too many CONTINUATION frames in one block causes a protocol
error.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(f... |
Receiving too many CONTINUATION frames in one block causes a protocol
error.
| test_prevent_continuation_dos | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_reject_invalid_settings_values(self, frame_factory, settings) -> None:
"""
When a SETTINGS frame is received with invalid settings values it
causes connection teardown with the appropriate error code.
"""
c = h2.connection.H2Connection(config=self.server_config)
... |
When a SETTINGS frame is received with invalid settings values it
causes connection teardown with the appropriate error code.
| test_reject_invalid_settings_values | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_invalid_frame_headers_are_protocol_errors(self, frame_factory, request_headers) -> None:
"""
When invalid frame headers are received they cause ProtocolErrors to be
raised.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
... |
When invalid frame headers are received they cause ProtocolErrors to be
raised.
| test_invalid_frame_headers_are_protocol_errors | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_data_before_headers(self, frame_factory, request_headers) -> None:
"""
When data frames are received before headers
they cause ProtocolErrors to be raised.
"""
c = h2.connection.H2Connection(config=self.client_config)
c.initiate_connection()
# transition ... |
When data frames are received before headers
they cause ProtocolErrors to be raised.
| test_data_before_headers | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_get_stream_reset_event_on_auto_reset(self, frame_factory, request_headers) -> None:
"""
When hyper-h2 resets a stream automatically, a StreamReset event fires.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(fr... |
When hyper-h2 resets a stream automatically, a StreamReset event fires.
| test_get_stream_reset_event_on_auto_reset | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_one_one_stream_reset(self, frame_factory, request_headers) -> None:
"""
When hyper-h2 resets a stream automatically, a StreamReset event fires,
but only for the first reset: the others are silent.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.in... |
When hyper-h2 resets a stream automatically, a StreamReset event fires,
but only for the first reset: the others are silent.
| test_one_one_stream_reset | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_error_on_invalid_content_length(self, frame_factory, value, request_headers) -> None:
"""
When an invalid content-length is received, a ProtocolError is thrown.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(f... |
When an invalid content-length is received, a ProtocolError is thrown.
| test_error_on_invalid_content_length | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_invalid_header_data_protocol_error(self, frame_factory, request_headers) -> None:
"""
If an invalid header block is received, we raise a ProtocolError.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_fact... |
If an invalid header block is received, we raise a ProtocolError.
| test_invalid_header_data_protocol_error | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_invalid_push_promise_data_protocol_error(self, frame_factory, request_headers) -> None:
"""
If an invalid header block is received on a PUSH_PROMISE, we raise a
ProtocolError.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(str... |
If an invalid header block is received on a PUSH_PROMISE, we raise a
ProtocolError.
| test_invalid_push_promise_data_protocol_error | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_cannot_receive_push_on_pushed_stream(self, frame_factory, request_headers) -> None:
"""
If a PUSH_PROMISE frame is received with the parent stream ID being a
pushed stream, this is rejected with a PROTOCOL_ERROR.
"""
c = h2.connection.H2Connection()
c.initiate_co... |
If a PUSH_PROMISE frame is received with the parent stream ID being a
pushed stream, this is rejected with a PROTOCOL_ERROR.
| test_cannot_receive_push_on_pushed_stream | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_cannot_send_push_on_pushed_stream(self, frame_factory, request_headers) -> None:
"""
If a user tries to send a PUSH_PROMISE frame with the parent stream ID
being a pushed stream, this is rejected with a PROTOCOL_ERROR.
"""
c = h2.connection.H2Connection(config=self.serve... |
If a user tries to send a PUSH_PROMISE frame with the parent stream ID
being a pushed stream, this is rejected with a PROTOCOL_ERROR.
| test_cannot_send_push_on_pushed_stream | python | python-hyper/h2 | tests/test_invalid_frame_sequences.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_frame_sequences.py | MIT |
def test_headers_event(self, frame_factory, headers) -> None:
"""
Test invalid headers are rejected with PROTOCOL_ERROR.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())
c.clear_outbound_data_buffer()
f = fram... |
Test invalid headers are rejected with PROTOCOL_ERROR.
| test_headers_event | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_push_promise_event(self, frame_factory, headers) -> None:
"""
If a PUSH_PROMISE header frame is received with an invalid header block
it is rejected with a PROTOCOL_ERROR.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
... |
If a PUSH_PROMISE header frame is received with an invalid header block
it is rejected with a PROTOCOL_ERROR.
| test_push_promise_event | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_push_promise_skipping_validation(self, frame_factory, headers) -> None:
"""
If we have ``validate_inbound_headers`` disabled, then invalid header
blocks in push promise frames are allowed to pass.
"""
config = h2.config.H2Configuration(
client_side=True,
... |
If we have ``validate_inbound_headers`` disabled, then invalid header
blocks in push promise frames are allowed to pass.
| test_push_promise_skipping_validation | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_headers_event_skipping_validation(self, frame_factory, headers) -> None:
"""
If we have ``validate_inbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass.
"""
config = h2.config.H2Configuration(
client_side=False,
... |
If we have ``validate_inbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass.
| test_headers_event_skipping_validation | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_te_trailers_is_valid(self, frame_factory) -> None:
"""
`te: trailers` is allowed by the filter.
"""
headers = (
[*self.base_request_headers, ("te", "trailers")]
)
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_... |
`te: trailers` is allowed by the filter.
| test_te_trailers_is_valid | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_pseudo_headers_rejected_in_trailer(self, frame_factory) -> None:
"""
Ensure we reject pseudo headers included in trailers
"""
trailers = [(":path", "/"), ("extra", "value")]
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.p... |
Ensure we reject pseudo headers included in trailers
| test_pseudo_headers_rejected_in_trailer | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_headers_event(self, frame_factory, headers) -> None:
"""
Test sending invalid headers raise a ProtocolError.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Clear the data, then try to send headers.
c.clear_outbound_data_buffer()
w... |
Test sending invalid headers raise a ProtocolError.
| test_headers_event | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_send_push_promise(self, frame_factory, headers) -> None:
"""
Sending invalid headers in a push promise raises a ProtocolError.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
Sending invalid headers in a push promise raises a ProtocolError.
| test_send_push_promise | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_headers_event_skipping_validation(self, frame_factory, headers) -> None:
"""
If we have ``validate_outbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass.
"""
config = h2.config.H2Configuration(
validate_outbound_headers=Fals... |
If we have ``validate_outbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass.
| test_headers_event_skipping_validation | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_headers_event_skip_normalization(self, frame_factory, headers) -> None:
"""
If we have ``normalize_outbound_headers`` disabled, then all of these
invalid header blocks are sent through unmodified.
"""
config = h2.config.H2Configuration(
validate_outbound_head... |
If we have ``normalize_outbound_headers`` disabled, then all of these
invalid header blocks are sent through unmodified.
| test_headers_event_skip_normalization | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_push_promise_skip_normalization(self, frame_factory, headers) -> None:
"""
If we have ``normalize_outbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass unmodified.
"""
config = h2.config.H2Configuration(
client_side=False,
... |
If we have ``normalize_outbound_headers`` disabled, then all of these
invalid header blocks are allowed to pass unmodified.
| test_push_promise_skip_normalization | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_strippable_headers(self, frame_factory, headers) -> None:
"""
Test connection related headers are removed before sending.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Clear the data, then try to send headers.
c.clear_outbound_data_buffe... |
Test connection related headers are removed before sending.
| test_strippable_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_range_of_acceptable_outputs(self,
headers,
validation_function,
hdr_validation_flags) -> None:
"""
The header validation functions either return the data unchanged
... |
The header validation functions either return the data unchanged
or throw a ProtocolError.
| test_range_of_acceptable_outputs | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_matching_authority_host_headers(self,
validation_function,
hdr_validation_flags) -> None:
"""
If a header block has :authority and Host headers and they match,
the headers should pass through uncha... |
If a header block has :authority and Host headers and they match,
the headers should pass through unchanged.
| test_matching_authority_host_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_outbound_req_header_extra_pseudo_headers(self,
hdr_validation_flags,
invalid_header) -> None:
"""
Outbound request header blocks containing the forbidden request headers
fail vali... |
Outbound request header blocks containing the forbidden request headers
fail validation.
| test_outbound_req_header_extra_pseudo_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_inbound_req_header_extra_pseudo_headers(self,
hdr_validation_flags,
invalid_header) -> None:
"""
Inbound request header blocks containing the forbidden request headers
fail validati... |
Inbound request header blocks containing the forbidden request headers
fail validation.
| test_inbound_req_header_extra_pseudo_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_outbound_resp_header_extra_pseudo_headers(self,
hdr_validation_flags,
invalid_header) -> None:
"""
Outbound response header blocks containing the forbidden response
headers fail... |
Outbound response header blocks containing the forbidden response
headers fail validation.
| test_outbound_resp_header_extra_pseudo_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_inbound_resp_header_extra_pseudo_headers(self,
hdr_validation_flags,
invalid_header) -> None:
"""
Inbound response header blocks containing the forbidden response
headers fail val... |
Inbound response header blocks containing the forbidden response
headers fail validation.
| test_inbound_resp_header_extra_pseudo_headers | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_hpack_bomb_request(self, frame_factory) -> None:
"""
A HPACK bomb request causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())
c... |
A HPACK bomb request causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
| test_hpack_bomb_request | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_hpack_bomb_response(self, frame_factory) -> None:
"""
A HPACK bomb response causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
stream_id=1, ... |
A HPACK bomb response causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
| test_hpack_bomb_response | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_hpack_bomb_push(self, frame_factory) -> None:
"""
A HPACK bomb push causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
stream_id=1, headers=... |
A HPACK bomb push causes the connection to be torn down with the
error code ENHANCE_YOUR_CALM.
| test_hpack_bomb_push | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_reject_headers_when_list_size_shrunk(self, frame_factory) -> None:
"""
When we've shrunk the header list size, we reject new header blocks
that violate the new size.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamb... |
When we've shrunk the header list size, we reject new header blocks
that violate the new size.
| test_reject_headers_when_list_size_shrunk | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_reject_headers_when_table_size_shrunk(self, frame_factory) -> None:
"""
When we've shrunk the header table size, we reject header blocks that
do not respect the change.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.pre... |
When we've shrunk the header table size, we reject header blocks that
do not respect the change.
| test_reject_headers_when_table_size_shrunk | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_reject_headers_exceeding_table_size(self, frame_factory) -> None:
"""
When the remote peer sends a dynamic table size update that exceeds our
setting, we reject it.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preambl... |
When the remote peer sends a dynamic table size update that exceeds our
setting, we reject it.
| test_reject_headers_exceeding_table_size | python | python-hyper/h2 | tests/test_invalid_headers.py | https://github.com/python-hyper/h2/blob/master/tests/test_invalid_headers.py | MIT |
def test_streams_may_not_depend_on_themselves(self, frame_factory, request_headers) -> None:
"""
A stream adjusted to depend on itself causes a Protocol Error.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_facto... |
A stream adjusted to depend on itself causes a Protocol Error.
| test_streams_may_not_depend_on_themselves | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_emit_headers_with_priority_info(self, depends_on, weight,
exclusive, frame_factory, request_headers) -> None:
"""
It is possible to send a headers frame with priority information on
it.
"""
c = h2.connection.H2Connection()
... |
It is possible to send a headers frame with priority information on
it.
| test_emit_headers_with_priority_info | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_may_not_initially_set_stream_depend_on_self(self, frame_factory, request_headers) -> None:
"""
A stream that starts by depending on itself causes a Protocol Error.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.receive_data(frame_factory.preamble(... |
A stream that starts by depending on itself causes a Protocol Error.
| test_may_not_initially_set_stream_depend_on_self | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_prioritize_requires_valid_weight(self, weight) -> None:
"""
A call to prioritize with an invalid weight causes a ProtocolError.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_outbound_data_buffer()
with pytest.raises(h2.exceptions.P... |
A call to prioritize with an invalid weight causes a ProtocolError.
| test_prioritize_requires_valid_weight | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_send_headers_requires_valid_weight(self, weight, request_headers) -> None:
"""
A call to send_headers with an invalid weight causes a ProtocolError.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_outbound_data_buffer()
with pytest.r... |
A call to send_headers with an invalid weight causes a ProtocolError.
| test_send_headers_requires_valid_weight | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_servers_cannot_prioritize(self, frame_factory, request_headers) -> None:
"""
Server stacks are not allowed to call ``prioritize()``.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
Server stacks are not allowed to call ``prioritize()``.
| test_servers_cannot_prioritize | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_servers_cannot_prioritize_with_headers(self, frame_factory, request_headers) -> None:
"""
Server stacks are not allowed to prioritize on headers either.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_fac... |
Server stacks are not allowed to prioritize on headers either.
| test_servers_cannot_prioritize_with_headers | python | python-hyper/h2 | tests/test_priority.py | https://github.com/python-hyper/h2/blob/master/tests/test_priority.py | MIT |
def test_request_received_related_all(self, frame_factory, request_headers) -> None:
"""
RequestReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
"""
c = h2.connection.H2Connection(config=self.server_conf... |
RequestReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
| test_request_received_related_all | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_request_received_related_priority(self, frame_factory, request_headers) -> None:
"""
RequestReceived can be related to PriorityUpdated.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
RequestReceived can be related to PriorityUpdated.
| test_request_received_related_priority | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_request_received_related_stream_ended(self, frame_factory, request_headers) -> None:
"""
RequestReceived can be related to StreamEnded.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
RequestReceived can be related to StreamEnded.
| test_request_received_related_stream_ended | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_response_received_related_nothing(self, frame_factory, request_headers) -> None:
"""
ResponseReceived is ordinarily related to no events.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
in... |
ResponseReceived is ordinarily related to no events.
| test_response_received_related_nothing | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_response_received_related_all(self, frame_factory, request_headers) -> None:
"""
ResponseReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
"""
c = h2.connection.H2Connection()
c.initiate_... |
ResponseReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
| test_response_received_related_all | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_response_received_related_priority(self, frame_factory, request_headers) -> None:
"""
ResponseReceived can be related to PriorityUpdated.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
in... |
ResponseReceived can be related to PriorityUpdated.
| test_response_received_related_priority | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_response_received_related_stream_ended(self, frame_factory, request_headers) -> None:
"""
ResponseReceived can be related to StreamEnded.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
in... |
ResponseReceived can be related to StreamEnded.
| test_response_received_related_stream_ended | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_trailers_received_related_all(self, frame_factory, request_headers) -> None:
"""
TrailersReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
"""
c = h2.connection.H2Connection()
c.initiate_... |
TrailersReceived has two possible related events: PriorityUpdated and
StreamEnded, all fired when a single HEADERS frame is received.
| test_trailers_received_related_all | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_trailers_received_related_stream_ended(self, frame_factory, request_headers) -> None:
"""
TrailersReceived can be related to StreamEnded by itself.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
... |
TrailersReceived can be related to StreamEnded by itself.
| test_trailers_received_related_stream_ended | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_informational_response_related_nothing(self, frame_factory, request_headers) -> None:
"""
InformationalResponseReceived in the standard case is related to
nothing.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, he... |
InformationalResponseReceived in the standard case is related to
nothing.
| test_informational_response_related_nothing | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_informational_response_received_related_all(self, frame_factory, request_headers) -> None:
"""
InformationalResponseReceived has one possible related event:
PriorityUpdated, fired when a single HEADERS frame is received.
"""
c = h2.connection.H2Connection()
c.ini... |
InformationalResponseReceived has one possible related event:
PriorityUpdated, fired when a single HEADERS frame is received.
| test_informational_response_received_related_all | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_data_received_normally_relates_to_nothing(self, frame_factory, request_headers) -> None:
"""
A plain DATA frame leads to DataReceieved with no related events.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request... |
A plain DATA frame leads to DataReceieved with no related events.
| test_data_received_normally_relates_to_nothing | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_data_received_related_stream_ended(self, frame_factory, request_headers) -> None:
"""
DataReceived can be related to StreamEnded by itself.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
... |
DataReceived can be related to StreamEnded by itself.
| test_data_received_related_stream_ended | python | python-hyper/h2 | tests/test_related_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_related_events.py | MIT |
def test_receiving_altsvc_stream_zero(self, frame_factory) -> None:
"""
An ALTSVC frame received on stream zero correctly transposes all the
fields from the frames.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_outbound_data_buffer()
... |
An ALTSVC frame received on stream zero correctly transposes all the
fields from the frames.
| test_receiving_altsvc_stream_zero | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_stream_zero_no_origin(self, frame_factory) -> None:
"""
An ALTSVC frame received on stream zero without an origin field is
ignored.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_outbound_data_buffer()
f = f... |
An ALTSVC frame received on stream zero without an origin field is
ignored.
| test_receiving_altsvc_stream_zero_no_origin | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_on_stream(self, frame_factory, request_headers) -> None:
"""
An ALTSVC frame received on a stream correctly transposes all the
fields from the frame and attaches the expected origin.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
... |
An ALTSVC frame received on a stream correctly transposes all the
fields from the frame and attaches the expected origin.
| test_receiving_altsvc_on_stream | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_on_stream_with_origin(self, frame_factory, request_headers) -> None:
"""
An ALTSVC frame received on a stream with an origin field present gets
ignored.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id... |
An ALTSVC frame received on a stream with an origin field present gets
ignored.
| test_receiving_altsvc_on_stream_with_origin | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_on_stream_not_yet_opened(self, frame_factory) -> None:
"""
When an ALTSVC frame is received on a stream the client hasn't yet
opened, the frame is ignored.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_outbound_data... |
When an ALTSVC frame is received on a stream the client hasn't yet
opened, the frame is ignored.
| test_receiving_altsvc_on_stream_not_yet_opened | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_before_sending_headers(self, frame_factory) -> None:
"""
When an ALTSVC frame is received but the client hasn't sent headers yet
it gets ignored.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# We need to create the idle s... |
When an ALTSVC frame is received but the client hasn't sent headers yet
it gets ignored.
| test_receiving_altsvc_before_sending_headers | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_after_receiving_headers(self, frame_factory, request_headers) -> None:
"""
When an ALTSVC frame is received but the server has already sent
headers it gets ignored.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_heade... |
When an ALTSVC frame is received but the server has already sent
headers it gets ignored.
| test_receiving_altsvc_after_receiving_headers | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_on_closed_stream(self, frame_factory, request_headers) -> None:
"""
When an ALTSVC frame is received on a closed stream, we ignore it.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
stream_id=1, headers=r... |
When an ALTSVC frame is received on a closed stream, we ignore it.
| test_receiving_altsvc_on_closed_stream | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_on_pushed_stream(self, frame_factory, request_headers) -> None:
"""
When an ALTSVC frame is received on a stream that the server pushed,
the frame is accepted.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(st... |
When an ALTSVC frame is received on a stream that the server pushed,
the frame is accepted.
| test_receiving_altsvc_on_pushed_stream | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_cannot_send_explicit_alternative_service(self, frame_factory, request_headers) -> None:
"""
A client cannot send an explicit alternative service.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
... |
A client cannot send an explicit alternative service.
| test_cannot_send_explicit_alternative_service | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_cannot_send_implicit_alternative_service(self, frame_factory, request_headers) -> None:
"""
A client cannot send an implicit alternative service.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(stream_id=1, headers=request_headers)
... |
A client cannot send an implicit alternative service.
| test_cannot_send_implicit_alternative_service | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_as_server_stream_zero(self, frame_factory) -> None:
"""
When an ALTSVC frame is received on stream zero and we are a server,
we ignore it.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_dat... |
When an ALTSVC frame is received on stream zero and we are a server,
we ignore it.
| test_receiving_altsvc_as_server_stream_zero | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_receiving_altsvc_as_server_on_stream(self, frame_factory, request_headers) -> None:
"""
When an ALTSVC frame is received on a stream and we are a server, we
ignore it.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c... |
When an ALTSVC frame is received on a stream and we are a server, we
ignore it.
| test_receiving_altsvc_as_server_on_stream | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_sending_explicit_alternative_service(self, frame_factory) -> None:
"""
A server can send an explicit alternative service.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
c.clea... |
A server can send an explicit alternative service.
| test_sending_explicit_alternative_service | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_sending_implicit_alternative_service(self, frame_factory, request_headers) -> None:
"""
A server can send an implicit alternative service.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble(... |
A server can send an implicit alternative service.
| test_sending_implicit_alternative_service | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_no_implicit_alternative_service_before_headers(self,
frame_factory) -> None:
"""
If headers haven't been received yet, the server forbids sending an
implicit alternative service.
"""
c = h2.connection.H2Connecti... |
If headers haven't been received yet, the server forbids sending an
implicit alternative service.
| test_no_implicit_alternative_service_before_headers | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_no_implicit_alternative_service_after_response(self,
frame_factory,
request_headers) -> None:
"""
If the server has sent response headers, hyper-h2 forbids sending an
... |
If the server has sent response headers, hyper-h2 forbids sending an
implicit alternative service.
| test_no_implicit_alternative_service_after_response | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_cannot_provide_origin_and_stream_id(self, frame_factory, request_headers) -> None:
"""
The user cannot provide both the origin and stream_id arguments when
advertising alternative services.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_... |
The user cannot provide both the origin and stream_id arguments when
advertising alternative services.
| test_cannot_provide_origin_and_stream_id | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_cannot_provide_unicode_altsvc_field(self, frame_factory) -> None:
"""
The user cannot provide the field value for alternative services as a
unicode string.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_dat... |
The user cannot provide the field value for alternative services as a
unicode string.
| test_cannot_provide_unicode_altsvc_field | python | python-hyper/h2 | tests/test_rfc7838.py | https://github.com/python-hyper/h2/blob/master/tests/test_rfc7838.py | MIT |
def test_settings_defaults_client(self) -> None:
"""
The Settings object begins with the appropriate defaults for clients.
"""
s = h2.settings.Settings(client=True)
assert s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 4096
assert s[h2.settings.SettingCodes.ENABLE_PUSH... |
The Settings object begins with the appropriate defaults for clients.
| test_settings_defaults_client | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_settings_defaults_server(self) -> None:
"""
The Settings object begins with the appropriate defaults for servers.
"""
s = h2.settings.Settings(client=False)
assert s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 4096
assert s[h2.settings.SettingCodes.ENABLE_PUS... |
The Settings object begins with the appropriate defaults for servers.
| test_settings_defaults_server | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_can_set_initial_values(self, client) -> None:
"""
The Settings object can be provided initial values that override the
defaults.
"""
overrides = {
h2.settings.SettingCodes.HEADER_TABLE_SIZE: 8080,
h2.settings.SettingCodes.MAX_FRAME_SIZE: 16388,
... |
The Settings object can be provided initial values that override the
defaults.
| test_can_set_initial_values | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_applying_value_doesnt_take_effect_immediately(self) -> None:
"""
When a value is applied to the settings object, it doesn't immediately
take effect.
"""
s = h2.settings.Settings(client=True)
s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 8000
assert s[... |
When a value is applied to the settings object, it doesn't immediately
take effect.
| test_applying_value_doesnt_take_effect_immediately | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_acknowledging_values(self) -> None:
"""
When we acknowledge settings, the values change.
"""
s = h2.settings.Settings(client=True)
old_settings = dict(s)
new_settings = {
h2.settings.SettingCodes.HEADER_TABLE_SIZE: 4000,
h2.settings.Setti... |
When we acknowledge settings, the values change.
| test_acknowledging_values | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_acknowledging_only_returns_changed_settings(self) -> None:
"""
Acknowledging settings does not return unchanged settings.
"""
s = h2.settings.Settings(client=True)
s[h2.settings.SettingCodes.INITIAL_WINDOW_SIZE] = 70
changes = s.acknowledge()
assert len(... |
Acknowledging settings does not return unchanged settings.
| test_acknowledging_only_returns_changed_settings | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_deleting_values_deletes_all_of_them(self) -> None:
"""
When we delete a key we lose all state about it.
"""
s = h2.settings.Settings(client=True)
s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 8000
del s[h2.settings.SettingCodes.HEADER_TABLE_SIZE]
wit... |
When we delete a key we lose all state about it.
| test_deleting_values_deletes_all_of_them | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_length_correctly_reported(self) -> None:
"""
Length is related only to the number of keys.
"""
s = h2.settings.Settings(client=True)
assert len(s) == 5
s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 8000
assert len(s) == 5
s.acknowledge()
... |
Length is related only to the number of keys.
| test_length_correctly_reported | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_new_values_follow_basic_acknowledgement_rules(self) -> None:
"""
A new value properly appears when acknowledged.
"""
s = h2.settings.Settings(client=True)
s[80] = 81
changed_settings = s.acknowledge()
assert s[80] == 81
assert len(changed_setting... |
A new value properly appears when acknowledged.
| test_new_values_follow_basic_acknowledgement_rules | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_single_values_arent_affected_by_acknowledgement(self) -> None:
"""
When acknowledged, unchanged settings remain unchanged.
"""
s = h2.settings.Settings(client=True)
assert s[h2.settings.SettingCodes.HEADER_TABLE_SIZE] == 4096
s.acknowledge()
assert s[h2.... |
When acknowledged, unchanged settings remain unchanged.
| test_single_values_arent_affected_by_acknowledgement | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
def test_settings_getters(self) -> None:
"""
Getters exist for well-known settings.
"""
s = h2.settings.Settings(client=True)
assert s.header_table_size == (
s[h2.settings.SettingCodes.HEADER_TABLE_SIZE]
)
assert s.enable_push == s[h2.settings.Setting... |
Getters exist for well-known settings.
| test_settings_getters | python | python-hyper/h2 | tests/test_settings.py | https://github.com/python-hyper/h2/blob/master/tests/test_settings.py | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.