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_cookies_arent_joined_without_normalization(self, frame_factory) -> None:
"""
If inbound header normalization is disabled, cookie headers aren't
joined.
"""
# This is a moderately varied set of cookie headers: some combined,
# some split.
cookie_headers = ... |
If inbound header normalization is disabled, cookie headers aren't
joined.
| test_cookies_arent_joined_without_normalization | python | python-hyper/h2 | tests/test_basic_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_basic_logic.py | MIT |
def test_stream_repr(self) -> None:
"""
Ensure stream string representation is appropriate.
"""
s = h2.stream.H2Stream(4, None, 12, 14)
assert repr(s) == "<H2Stream id:4 state:<StreamState.IDLE: 0>>" |
Ensure stream string representation is appropriate.
| test_stream_repr | python | python-hyper/h2 | tests/test_basic_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_basic_logic.py | MIT |
def sanity_check_data_frame(data_frame,
expected_flow_controlled_length,
expect_padded_flag,
expected_data_frame_pad_length) -> None:
"""
``data_frame`` is a frame of type ``hyperframe.frame.DataFrame``,
and the ``flags`` an... |
``data_frame`` is a frame of type ``hyperframe.frame.DataFrame``,
and the ``flags`` and ``flow_controlled_length`` of ``data_frame``
match expectations.
| sanity_check_data_frame | python | python-hyper/h2 | tests/test_basic_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_basic_logic.py | MIT |
def test_can_receive_multiple_rst_stream_frames(self, frame_factory) -> None:
"""
Multiple RST_STREAM frames can be received, either at once or well
after one another. Only the first fires an event.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.se... |
Multiple RST_STREAM frames can be received, either at once or well
after one another. Only the first fires an event.
| test_can_receive_multiple_rst_stream_frames | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_receiving_low_stream_id_causes_goaway(self, frame_factory) -> None:
"""
The remote peer creating a stream with a lower ID than one we've seen
causes a GOAWAY frame.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preambl... |
The remote peer creating a stream with a lower ID than one we've seen
causes a GOAWAY frame.
| test_receiving_low_stream_id_causes_goaway | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_closed_stream_not_present_in_streams_dict(self, frame_factory) -> None:
"""
When streams have been closed, they get removed from the streams
dictionary the next time we count the open streams.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receiv... |
When streams have been closed, they get removed from the streams
dictionary the next time we count the open streams.
| test_closed_stream_not_present_in_streams_dict | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_receive_rst_stream_on_closed_stream(self, frame_factory) -> None:
"""
RST_STREAM frame should be ignored if stream is in a closed state.
See RFC 7540 Section 5.1 (closed state)
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Client sends r... |
RST_STREAM frame should be ignored if stream is in a closed state.
See RFC 7540 Section 5.1 (closed state)
| test_receive_rst_stream_on_closed_stream | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_receive_window_update_on_closed_stream(self, frame_factory) -> None:
"""
WINDOW_UPDATE frame should be ignored if stream is in a closed state.
See RFC 7540 Section 5.1 (closed state)
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Client s... |
WINDOW_UPDATE frame should be ignored if stream is in a closed state.
See RFC 7540 Section 5.1 (closed state)
| test_receive_window_update_on_closed_stream | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_frames_after_recv_end_will_error(self,
frame_factory,
frame,
clear_streams) -> None:
"""
A stream that is closed by receiving END_STREAM raises
Proto... |
A stream that is closed by receiving END_STREAM raises
ProtocolError when it receives an unexpected frame.
| test_frames_after_recv_end_will_error | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_frames_after_send_end_will_error(self,
frame_factory,
frame,
clear_streams) -> None:
"""
A stream that is closed by sending END_STREAM raises
Protoco... |
A stream that is closed by sending END_STREAM raises
ProtocolError when it receives an unexpected frame.
| test_frames_after_send_end_will_error | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_frames_after_send_end_will_be_ignored(self,
frame_factory,
frame) -> None:
"""
A stream that is closed by sending END_STREAM will raise
ProtocolError when received unexpected frame.
... |
A stream that is closed by sending END_STREAM will raise
ProtocolError when received unexpected frame.
| test_frames_after_send_end_will_be_ignored | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_resets_further_frames_after_recv_reset(self,
frame_factory,
frame) -> None:
"""
A stream that is closed by receive RST_STREAM can receive further
frames: it simply sends RST_STREAM fo... |
A stream that is closed by receive RST_STREAM can receive further
frames: it simply sends RST_STREAM for it, and additionally
WINDOW_UPDATE for DATA frames.
| test_resets_further_frames_after_recv_reset | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_resets_further_data_frames_after_recv_reset(self,
frame_factory) -> None:
"""
A stream that is closed by receive RST_STREAM can receive further
DATA frames: it simply sends WINDOW_UPDATE for the connection flow
window, and... |
A stream that is closed by receive RST_STREAM can receive further
DATA frames: it simply sends WINDOW_UPDATE for the connection flow
window, and RST_STREAM for the stream.
| test_resets_further_data_frames_after_recv_reset | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_resets_further_frames_after_send_reset(self,
frame_factory,
frame) -> None:
"""
A stream that is closed by sent RST_STREAM can receive further frames:
it simply sends RST_STREAM for i... |
A stream that is closed by sent RST_STREAM can receive further frames:
it simply sends RST_STREAM for it.
| test_resets_further_frames_after_send_reset | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_resets_further_data_frames_after_send_reset(self,
frame_factory) -> None:
"""
A stream that is closed by sent RST_STREAM can receive further
data frames: it simply sends WINDOW_UPDATE and RST_STREAM for it.
"""
c =... |
A stream that is closed by sent RST_STREAM can receive further
data frames: it simply sends WINDOW_UPDATE and RST_STREAM for it.
| test_resets_further_data_frames_after_send_reset | python | python-hyper/h2 | tests/test_closed_streams.py | https://github.com/python-hyper/h2/blob/master/tests/test_closed_streams.py | MIT |
def test_correctly_count_server_streams(self, frame_factory) -> None:
"""
We correctly count the number of server streams, both inbound and
outbound.
"""
# This test makes no sense unless you do both inbound and outbound,
# because it's important to confirm that we count ... |
We correctly count the number of server streams, both inbound and
outbound.
| test_correctly_count_server_streams | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_correctly_count_server_streams(self, frame_factory) -> None:
"""
We correctly count the number of server streams, both inbound and
outbound.
"""
# This test makes no sense unless you do both inbound and outbound,
# because it's important to confirm that we count ... |
We correctly count the number of server streams, both inbound and
outbound.
| test_correctly_count_server_streams | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_frame_basic(self, frame_factory) -> None:
"""
Test that we correctly decode a header block split across continuation
frames.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.pr... |
Test that we correctly decode a header block split across continuation
frames.
| test_continuation_frame_basic | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_headers(self,
frame_factory,
stream_id) -> None:
"""
We cannot interleave a new headers block with a CONTINUATION sequence.
"""
c = h2.connectio... |
We cannot interleave a new headers block with a CONTINUATION sequence.
| test_continuation_cannot_interleave_headers | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_data(self, frame_factory) -> None:
"""
We cannot interleave a data frame with a CONTINUATION sequence.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.preamble())
... |
We cannot interleave a data frame with a CONTINUATION sequence.
| test_continuation_cannot_interleave_data | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_unknown_frame(self, frame_factory) -> None:
"""
We cannot interleave an unknown frame with a CONTINUATION sequence.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data(frame_factory.p... |
We cannot interleave an unknown frame with a CONTINUATION sequence.
| test_continuation_cannot_interleave_unknown_frame | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_frame_multiple_blocks(self, frame_factory) -> None:
"""
Test that we correctly decode several header blocks split across
continuation frames.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_connection()
c.receive_data... |
Test that we correctly decode several header blocks split across
continuation frames.
| test_continuation_frame_multiple_blocks | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_frame_basic_push_promise(self, frame_factory) -> None:
"""
Test that we correctly decode a header block split across continuation
frames when that header block is initiated with a PUSH_PROMISE.
"""
c = h2.connection.H2Connection()
c.initiate_connecti... |
Test that we correctly decode a header block split across continuation
frames when that header block is initiated with a PUSH_PROMISE.
| test_continuation_frame_basic_push_promise | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_headers_pp(self,
frame_factory,
stream_id) -> None:
"""
We cannot interleave a new headers block with a CONTINUATION sequence
when the headers blo... |
We cannot interleave a new headers block with a CONTINUATION sequence
when the headers block is based on a PUSH_PROMISE frame.
| test_continuation_cannot_interleave_headers_pp | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_data(self, frame_factory) -> None:
"""
We cannot interleave a data frame with a CONTINUATION sequence when
that sequence began with a PUSH_PROMISE frame.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_he... |
We cannot interleave a data frame with a CONTINUATION sequence when
that sequence began with a PUSH_PROMISE frame.
| test_continuation_cannot_interleave_data | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_cannot_interleave_unknown_frame(self, frame_factory) -> None:
"""
We cannot interleave an unknown frame with a CONTINUATION sequence when
that sequence began with a PUSH_PROMISE frame.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
... |
We cannot interleave an unknown frame with a CONTINUATION sequence when
that sequence began with a PUSH_PROMISE frame.
| test_continuation_cannot_interleave_unknown_frame | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_stream_remotely_closed_disallows_push_promise(self,
evict,
frame_factory) -> None:
"""
Streams closed normally by the remote peer disallow PUSH_PROMISE
frames, and cause... |
Streams closed normally by the remote peer disallow PUSH_PROMISE
frames, and cause a GOAWAY.
| test_stream_remotely_closed_disallows_push_promise | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_continuation_frame_multiple_push_promise(self, frame_factory) -> None:
"""
Test that we correctly decode header blocks split across continuation
frames when those header block is initiated with a PUSH_PROMISE, for
more than one pushed stream.
"""
c = h2.connecti... |
Test that we correctly decode header blocks split across continuation
frames when those header block is initiated with a PUSH_PROMISE, for
more than one pushed stream.
| test_continuation_frame_multiple_push_promise | python | python-hyper/h2 | tests/test_complex_logic.py | https://github.com/python-hyper/h2/blob/master/tests/test_complex_logic.py | MIT |
def test_defaults(self) -> None:
"""
The default values of the HTTP/2 config object are sensible.
"""
config = h2.config.H2Configuration()
assert config.client_side
assert config.header_encoding is None
assert isinstance(config.logger, h2.config.DummyLogger) |
The default values of the HTTP/2 config object are sensible.
| test_defaults | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_boolean_config_options_reject_non_bools_init(
self, option_name, value,
) -> None:
"""
The boolean config options raise an error if you try to set a value
that isn't a boolean via the initializer.
"""
with pytest.raises(ValueError):
h2.config.H2Co... |
The boolean config options raise an error if you try to set a value
that isn't a boolean via the initializer.
| test_boolean_config_options_reject_non_bools_init | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_boolean_config_options_reject_non_bools_attr(
self, option_name, value,
) -> None:
"""
The boolean config options raise an error if you try to set a value
that isn't a boolean via attribute setter.
"""
config = h2.config.H2Configuration()
with pytest.... |
The boolean config options raise an error if you try to set a value
that isn't a boolean via attribute setter.
| test_boolean_config_options_reject_non_bools_attr | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_boolean_config_option_is_reflected_init(self, option_name, value) -> None:
"""
The value of the boolean config options, when set, is reflected
in the value via the initializer.
"""
config = h2.config.H2Configuration(**{option_name: value})
assert getattr(config, ... |
The value of the boolean config options, when set, is reflected
in the value via the initializer.
| test_boolean_config_option_is_reflected_init | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_boolean_config_option_is_reflected_attr(self, option_name, value) -> None:
"""
The value of the boolean config options, when set, is reflected
in the value via attribute setter.
"""
config = h2.config.H2Configuration()
setattr(config, option_name, value)
... |
The value of the boolean config options, when set, is reflected
in the value via attribute setter.
| test_boolean_config_option_is_reflected_attr | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_header_encoding_must_be_false_str_none_init(
self, header_encoding,
) -> None:
"""
The value of the ``header_encoding`` setting must be False, a string,
or None via the initializer.
"""
with pytest.raises(ValueError):
h2.config.H2Configuration(hea... |
The value of the ``header_encoding`` setting must be False, a string,
or None via the initializer.
| test_header_encoding_must_be_false_str_none_init | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_header_encoding_must_be_false_str_none_attr(
self, header_encoding,
) -> None:
"""
The value of the ``header_encoding`` setting must be False, a string,
or None via attribute setter.
"""
config = h2.config.H2Configuration()
with pytest.raises(ValueErr... |
The value of the ``header_encoding`` setting must be False, a string,
or None via attribute setter.
| test_header_encoding_must_be_false_str_none_attr | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_header_encoding_is_reflected_init(self, header_encoding) -> None:
"""
The value of ``header_encoding``, when set, is reflected in the value
via the initializer.
"""
config = h2.config.H2Configuration(header_encoding=header_encoding)
assert config.header_encoding ... |
The value of ``header_encoding``, when set, is reflected in the value
via the initializer.
| test_header_encoding_is_reflected_init | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_header_encoding_is_reflected_attr(self, header_encoding) -> None:
"""
The value of ``header_encoding``, when set, is reflected in the value
via the attribute setter.
"""
config = h2.config.H2Configuration()
config.header_encoding = header_encoding
assert ... |
The value of ``header_encoding``, when set, is reflected in the value
via the attribute setter.
| test_header_encoding_is_reflected_attr | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_logger_instance_is_reflected(self) -> None:
"""
The value of ``logger``, when set, is reflected in the value.
"""
logger = logging.getLogger("hyper-h2.test")
config = h2.config.H2Configuration()
config.logger = logger
assert config.logger is logger |
The value of ``logger``, when set, is reflected in the value.
| test_logger_instance_is_reflected | python | python-hyper/h2 | tests/test_config.py | https://github.com/python-hyper/h2/blob/master/tests/test_config.py | MIT |
def test_building_settings_from_scratch(self, settings_list) -> None:
"""
Missing old settings are defaulted to None.
"""
settings_dict = dict(settings_list)
e = h2.events.RemoteSettingsChanged.from_settings(
old_settings={},
new_settings=settings_dict,
... |
Missing old settings are defaulted to None.
| test_building_settings_from_scratch | python | python-hyper/h2 | tests/test_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_events.py | MIT |
def test_only_reports_changed_settings(self,
old_settings_list,
new_settings_list) -> None:
"""
Settings that were not changed are not reported.
"""
old_settings_dict = dict(old_settings_list)
n... |
Settings that were not changed are not reported.
| test_only_reports_changed_settings | python | python-hyper/h2 | tests/test_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_events.py | MIT |
def test_correctly_reports_changed_settings(self,
old_settings_list,
new_settings_list) -> None:
"""
Settings that are changed are correctly reported.
"""
old_settings_dict = dict(old_settings... |
Settings that are changed are correctly reported.
| test_correctly_reports_changed_settings | python | python-hyper/h2 | tests/test_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_events.py | MIT |
def all_events():
"""
Generates all the classes (i.e., events) defined in h2.events.
"""
for _, obj in inspect.getmembers(sys.modules["h2.events"]):
# We are only interested in objects that are defined in h2.events;
# objects that are imported from other modules are not of interest.
... |
Generates all the classes (i.e., events) defined in h2.events.
| all_events | python | python-hyper/h2 | tests/test_events.py | https://github.com/python-hyper/h2/blob/master/tests/test_events.py | MIT |
def test_flow_control_initializes_properly(self) -> None:
"""
The flow control window for a stream should initially be the default
flow control value.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
assert c.local_flow_control... |
The flow control window for a stream should initially be the default
flow control value.
| test_flow_control_initializes_properly | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_decreases_with_sent_data(self) -> None:
"""
When data is sent on a stream, the flow control window should drop.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
c.send_data(1, b"some data")
remaining_lengt... |
When data is sent on a stream, the flow control window should drop.
| test_flow_control_decreases_with_sent_data | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_decreases_with_sent_data_with_padding(self,
pad_length) -> None:
"""
When padded data is sent on a stream, the flow control window drops
by the length of the padding plus 1 for the 1-byte padding length
... |
When padded data is sent on a stream, the flow control window drops
by the length of the padding plus 1 for the 1-byte padding length
field.
| test_flow_control_decreases_with_sent_data_with_padding | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_decreases_with_received_data(self, frame_factory) -> None:
"""
When data is received on a stream, the remote flow control window
should drop.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())
... |
When data is received on a stream, the remote flow control window
should drop.
| test_flow_control_decreases_with_received_data | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_decreases_with_padded_data(self, frame_factory) -> None:
"""
When padded data is received on a stream, the remote flow control
window drops by an amount that includes the padding.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receiv... |
When padded data is received on a stream, the remote flow control
window drops by an amount that includes the padding.
| test_flow_control_decreases_with_padded_data | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_cannot_send_more_data_than_window(self) -> None:
"""
Sending more data than the remaining flow control window raises a
FlowControlError.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
c.outbound_flow_control_window = ... |
Sending more data than the remaining flow control window raises a
FlowControlError.
| test_cannot_send_more_data_than_window | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_increasing_connection_window_allows_sending(self, frame_factory) -> None:
"""
Confirm that sending a WindowUpdate frame on the connection frees
up space for further frames.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
... |
Confirm that sending a WindowUpdate frame on the connection frees
up space for further frames.
| test_increasing_connection_window_allows_sending | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_increasing_stream_window_allows_sending(self, frame_factory) -> None:
"""
Confirm that sending a WindowUpdate frame on the connection frees
up space for further frames.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
c... |
Confirm that sending a WindowUpdate frame on the connection frees
up space for further frames.
| test_increasing_stream_window_allows_sending | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_shrinks_in_response_to_settings(self, frame_factory) -> None:
"""
Acknowledging SETTINGS_INITIAL_WINDOW_SIZE shrinks the flow control
window.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
assert c.local... |
Acknowledging SETTINGS_INITIAL_WINDOW_SIZE shrinks the flow control
window.
| test_flow_control_shrinks_in_response_to_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_grows_in_response_to_settings(self, frame_factory) -> None:
"""
Acknowledging SETTINGS_INITIAL_WINDOW_SIZE grows the flow control
window.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
# Greatly increase... |
Acknowledging SETTINGS_INITIAL_WINDOW_SIZE grows the flow control
window.
| test_flow_control_grows_in_response_to_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_flow_control_settings_blocked_by_conn_window(self, frame_factory) -> None:
"""
Changing SETTINGS_INITIAL_WINDOW_SIZE does not affect the effective
flow control window if the connection window isn't changed.
"""
c = h2.connection.H2Connection()
c.send_headers(1, s... |
Changing SETTINGS_INITIAL_WINDOW_SIZE does not affect the effective
flow control window if the connection window isn't changed.
| test_flow_control_settings_blocked_by_conn_window | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_new_streams_have_flow_control_per_settings(self, frame_factory) -> None:
"""
After a SETTINGS_INITIAL_WINDOW_SIZE change is received, new streams
have appropriate new flow control windows.
"""
c = h2.connection.H2Connection()
f = frame_factory.build_settings_fra... |
After a SETTINGS_INITIAL_WINDOW_SIZE change is received, new streams
have appropriate new flow control windows.
| test_new_streams_have_flow_control_per_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_window_update_no_stream(self, frame_factory) -> None:
"""
WindowUpdate frames received without streams fire an appropriate
WindowUpdated event.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())
f = fra... |
WindowUpdate frames received without streams fire an appropriate
WindowUpdated event.
| test_window_update_no_stream | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_window_update_with_stream(self, frame_factory) -> None:
"""
WindowUpdate frames received with streams fire an appropriate
WindowUpdated event.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())
f1 = fra... |
WindowUpdate frames received with streams fire an appropriate
WindowUpdated event.
| test_window_update_with_stream | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_we_can_increment_stream_flow_control(self, frame_factory) -> None:
"""
It is possible for the user to increase the flow control window for
streams.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, self.example_request_headers... |
It is possible for the user to increase the flow control window for
streams.
| test_we_can_increment_stream_flow_control | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_we_can_increment_connection_flow_control(self, frame_factory) -> None:
"""
It is possible for the user to increase the flow control window for
the entire connection.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, self.examp... |
It is possible for the user to increase the flow control window for
the entire connection.
| test_we_can_increment_connection_flow_control | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_we_enforce_our_flow_control_window(self, frame_factory) -> None:
"""
The user can set a low flow control window, which leads to connection
teardown if violated.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.preamble())... |
The user can set a low flow control window, which leads to connection
teardown if violated.
| test_we_enforce_our_flow_control_window | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_shrink_remote_flow_control_settings(self, frame_factory) -> None:
"""
The remote peer acknowledging our SETTINGS_INITIAL_WINDOW_SIZE shrinks
the flow control window.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
ass... |
The remote peer acknowledging our SETTINGS_INITIAL_WINDOW_SIZE shrinks
the flow control window.
| test_shrink_remote_flow_control_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_grow_remote_flow_control_settings(self, frame_factory) -> None:
"""
The remote peer acknowledging our SETTINGS_INITIAL_WINDOW_SIZE grows
the flow control window.
"""
c = h2.connection.H2Connection()
c.send_headers(1, self.example_request_headers)
# Incre... |
The remote peer acknowledging our SETTINGS_INITIAL_WINDOW_SIZE grows
the flow control window.
| test_grow_remote_flow_control_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_new_streams_have_remote_flow_control(self, frame_factory) -> None:
"""
After a SETTINGS_INITIAL_WINDOW_SIZE change is acknowledged by the
remote peer, new streams have appropriate new flow control windows.
"""
c = h2.connection.H2Connection()
c.update_settings(
... |
After a SETTINGS_INITIAL_WINDOW_SIZE change is acknowledged by the
remote peer, new streams have appropriate new flow control windows.
| test_new_streams_have_remote_flow_control | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_bad_attempts_to_increment_flow_control(self, increment) -> None:
"""
Attempting to increment a flow control increment outside the valid
range causes a ValueError to be raised.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_head... |
Attempting to increment a flow control increment outside the valid
range causes a ValueError to be raised.
| test_reject_bad_attempts_to_increment_flow_control | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_bad_remote_increments(self, frame_factory, stream_id) -> None:
"""
Remote peers attempting to increment flow control outside the valid
range cause connection errors of type PROTOCOL_ERROR.
"""
# The only number that can be encoded in a WINDOW_UPDATE frame but
... |
Remote peers attempting to increment flow control outside the valid
range cause connection errors of type PROTOCOL_ERROR.
| test_reject_bad_remote_increments | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_increasing_connection_window_too_far(self, frame_factory) -> None:
"""
Attempts by the remote peer to increase the connection flow control
window beyond 2**31 - 1 are rejected.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.clear_ou... |
Attempts by the remote peer to increase the connection flow control
window beyond 2**31 - 1 are rejected.
| test_reject_increasing_connection_window_too_far | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_increasing_stream_window_too_far(self, frame_factory) -> None:
"""
Attempts by the remote peer to increase the stream flow control window
beyond 2**31 - 1 are rejected.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, ... |
Attempts by the remote peer to increase the stream flow control window
beyond 2**31 - 1 are rejected.
| test_reject_increasing_stream_window_too_far | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_overlarge_conn_window_settings(self, frame_factory) -> None:
"""
SETTINGS frames cannot change the size of the connection flow control
window.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Go one byte smaller than the limit.
... |
SETTINGS frames cannot change the size of the connection flow control
window.
| test_reject_overlarge_conn_window_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_overlarge_stream_window_settings(self, frame_factory) -> None:
"""
Remote attempts to create overlarge stream windows via SETTINGS frames
are rejected.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, self.example_requ... |
Remote attempts to create overlarge stream windows via SETTINGS frames
are rejected.
| test_reject_overlarge_stream_window_settings | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_local_overlarge_increase_connection_window(self) -> None:
"""
Local attempts to increase the connection window too far are rejected.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
increment = 2**31 - c.inbound_flow_control_window
wi... |
Local attempts to increase the connection window too far are rejected.
| test_reject_local_overlarge_increase_connection_window | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_reject_local_overlarge_increase_stream_window(self) -> None:
"""
Local attempts to increase the connection window too far are rejected.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(1, self.example_request_headers)
increment... |
Local attempts to increase the connection window too far are rejected.
| test_reject_local_overlarge_increase_stream_window | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def _setup_connection_and_send_headers(self, frame_factory):
"""
Setup a server-side H2Connection and send a headers frame, and then
clear the outbound data buffer. Also increase the maximum frame size.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initi... |
Setup a server-side H2Connection and send a headers frame, and then
clear the outbound data buffer. Also increase the maximum frame size.
| _setup_connection_and_send_headers | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_must_acknowledge_for_stream(self, frame_factory, stream_id) -> None:
"""
Flow control acknowledgements must be done on a stream ID that is
greater than zero.
"""
# We need to refresh the encoder because hypothesis has a problem with
# integrating with py.test, me... |
Flow control acknowledgements must be done on a stream ID that is
greater than zero.
| test_must_acknowledge_for_stream | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_cannot_acknowledge_less_than_zero(self, frame_factory, size) -> None:
"""
The user must acknowledge at least 0 bytes.
"""
# We need to refresh the encoder because hypothesis has a problem with
# integrating with py.test, meaning that we use the same frame factory
... |
The user must acknowledge at least 0 bytes.
| test_cannot_acknowledge_less_than_zero | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_acknowledging_no_data_does_nothing(self, frame_factory) -> None:
"""
If a user accidentally acknowledges no data, nothing happens.
"""
c = self._setup_connection_and_send_headers(frame_factory)
# Send an empty data frame, just to give the user impetus to ack the
... |
If a user accidentally acknowledges no data, nothing happens.
| test_acknowledging_no_data_does_nothing | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_acknowledging_data_on_closed_stream(self,
frame_factory,
force_cleanup) -> None:
"""
When acknowledging data on a stream that has just been closed, no
acknowledgement is given for that stre... |
When acknowledging data on a stream that has just been closed, no
acknowledgement is given for that stream, only for the connection.
| test_acknowledging_data_on_closed_stream | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_acknowledging_streams_we_never_saw(self, frame_factory) -> None:
"""
If the user acknowledges a stream ID we've never seen, that raises a
NoSuchStreamError.
"""
c = self._setup_connection_and_send_headers(frame_factory)
c.clear_outbound_data_buffer()
wit... |
If the user acknowledges a stream ID we've never seen, that raises a
NoSuchStreamError.
| test_acknowledging_streams_we_never_saw | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_connection_only_empty(self, frame_factory, increment) -> None:
"""
If the connection flow control window is empty, but the stream flow
control windows aren't, and 1024 bytes or more are acknowledged by the
user, we increment the connection window only.
"""
# We n... |
If the connection flow control window is empty, but the stream flow
control windows aren't, and 1024 bytes or more are acknowledged by the
user, we increment the connection window only.
| test_connection_only_empty | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_mixing_update_forms(self, frame_factory, increment) -> None:
"""
If the user mixes acknowledging data with manually incrementing windows,
we still keep track of what's going on.
"""
# We need to refresh the encoder because hypothesis has a problem with
# integrat... |
If the user mixes acknowledging data with manually incrementing windows,
we still keep track of what's going on.
| test_mixing_update_forms | python | python-hyper/h2 | tests/test_flow_control_window.py | https://github.com/python-hyper/h2/blob/master/tests/test_flow_control_window.py | MIT |
def test_returns_http2_settings(self, frame_factory) -> None:
"""
Calling initiate_upgrade_connection returns a base64url encoded
Settings frame with the settings used by the connection.
"""
conn = h2.connection.H2Connection()
data = conn.initiate_upgrade_connection()
... |
Calling initiate_upgrade_connection returns a base64url encoded
Settings frame with the settings used by the connection.
| test_returns_http2_settings | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_can_receive_response(self, frame_factory) -> None:
"""
After upgrading, we can safely receive a response.
"""
c = h2.connection.H2Connection()
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
f1 = frame_factory.build_headers_frame(
... |
After upgrading, we can safely receive a response.
| test_can_receive_response | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_can_receive_pushed_stream(self, frame_factory, headers) -> None:
"""
After upgrading, we can safely receive a pushed stream.
"""
c = h2.connection.H2Connection()
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
f = frame_factory.build_push_... |
After upgrading, we can safely receive a pushed stream.
| test_can_receive_pushed_stream | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_cannot_send_headers_stream_1(self, frame_factory, headers) -> None:
"""
After upgrading, we cannot send headers on stream 1.
"""
c = h2.connection.H2Connection()
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
with pytest.raises(h2.excepti... |
After upgrading, we cannot send headers on stream 1.
| test_cannot_send_headers_stream_1 | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_cannot_send_data_stream_1(self, frame_factory) -> None:
"""
After upgrading, we cannot send data on stream 1.
"""
c = h2.connection.H2Connection()
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
with pytest.raises(h2.exceptions.ProtocolErr... |
After upgrading, we cannot send data on stream 1.
| test_cannot_send_data_stream_1 | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_can_send_response(self, frame_factory) -> None:
"""
After upgrading, we can safely send a response.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
c.send_headers(stream_id=1, h... |
After upgrading, we can safely send a response.
| test_can_send_response | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_can_push_stream(self, frame_factory, headers) -> None:
"""
After upgrading, we can safely push a stream.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_upgrade_connection()
c.clear_outbound_data_buffer()
c.push_stream(
... |
After upgrading, we can safely push a stream.
| test_can_push_stream | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_cannot_receive_headers_stream_1(self, frame_factory, headers) -> None:
"""
After upgrading, we cannot receive headers on stream 1.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_upgrade_connection()
c.receive_data(frame_factory.preamble(... |
After upgrading, we cannot receive headers on stream 1.
| test_cannot_receive_headers_stream_1 | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def test_cannot_receive_data_stream_1(self, frame_factory) -> None:
"""
After upgrading, we cannot receive data on stream 1.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.initiate_upgrade_connection()
c.receive_data(frame_factory.preamble())
c.cl... |
After upgrading, we cannot receive data on stream 1.
| test_cannot_receive_data_stream_1 | python | python-hyper/h2 | tests/test_h2_upgrade.py | https://github.com/python-hyper/h2/blob/master/tests/test_h2_upgrade.py | MIT |
def assert_header_blocks_actually_equal(block_a, block_b) -> None:
"""
Asserts that two header bocks are really, truly equal, down to the types
of their tuples. Doesn't return anything.
"""
assert len(block_a) == len(block_b)
for a, b in zip(block_a, block_b):
assert a == b
asse... |
Asserts that two header bocks are really, truly equal, down to the types
of their tuples. Doesn't return anything.
| assert_header_blocks_actually_equal | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_sending_header_tuples(self, headers, frame_factory) -> None:
"""
Providing HeaderTuple and HeaderTuple subclasses preserves the metadata
about indexing.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
# Clear the data, then send headers.
... |
Providing HeaderTuple and HeaderTuple subclasses preserves the metadata
about indexing.
| test_sending_header_tuples | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_header_tuples_in_pushes(self, headers, frame_factory) -> None:
"""
Providing HeaderTuple and HeaderTuple subclasses to push promises
preserves metadata about indexing.
"""
c = h2.connection.H2Connection(config=self.server_config)
c.receive_data(frame_factory.prea... |
Providing HeaderTuple and HeaderTuple subclasses to push promises
preserves metadata about indexing.
| test_header_tuples_in_pushes | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_authorization_headers_never_indexed(self,
headers,
auth_header,
frame_factory) -> None:
"""
Authorization and Proxy-Authorization headers are always... |
Authorization and Proxy-Authorization headers are always forced to be
never-indexed, regardless of their form.
| test_authorization_headers_never_indexed | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_authorization_headers_never_indexed_push(self,
headers,
auth_header,
frame_factory) -> None:
"""
Authorization and Proxy-Authorizatio... |
Authorization and Proxy-Authorization headers are always forced to be
never-indexed, regardless of their form, when pushed by a server.
| test_authorization_headers_never_indexed_push | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_short_cookie_headers_never_indexed(self,
headers,
cookie_header,
frame_factory) -> None:
"""
Short cookie headers, and cookies provided as NeverIndexed... |
Short cookie headers, and cookies provided as NeverIndexedHeaderTuple,
are never indexed.
| test_short_cookie_headers_never_indexed | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_short_cookie_headers_never_indexed_push(self,
headers,
cookie_header,
frame_factory) -> None:
"""
Short cookie headers, and cookies prov... |
Short cookie headers, and cookies provided as NeverIndexedHeaderTuple,
are never indexed when pushed by servers.
| test_short_cookie_headers_never_indexed_push | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_long_cookie_headers_can_be_indexed(self,
headers,
cookie_header,
frame_factory) -> None:
"""
Longer cookie headers can be indexed.
"""
... |
Longer cookie headers can be indexed.
| test_long_cookie_headers_can_be_indexed | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_long_cookie_headers_can_be_indexed_push(self,
headers,
cookie_header,
frame_factory) -> None:
"""
Longer cookie headers can be indexed.
... |
Longer cookie headers can be indexed.
| test_long_cookie_headers_can_be_indexed_push | python | python-hyper/h2 | tests/test_header_indexing.py | https://github.com/python-hyper/h2/blob/master/tests/test_header_indexing.py | MIT |
def test_single_informational_response(self, frame_factory, end_stream) -> None:
"""
When receiving a informational response, the appropriate event is
signaled.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
stream_id=1,
... |
When receiving a informational response, the appropriate event is
signaled.
| test_single_informational_response | 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_receiving_multiple_header_blocks(self, frame_factory, end_stream) -> None:
"""
At least three header blocks can be received: informational, headers,
trailers.
"""
c = h2.connection.H2Connection()
c.initiate_connection()
c.send_headers(
stream_... |
At least three header blocks can be received: informational, headers,
trailers.
| test_receiving_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_receiving_multiple_informational_responses(self,
frame_factory,
end_stream) -> None:
"""
More than one informational response is allowed.
"""
c = h2.connection.H2Conne... |
More than one informational response is allowed.
| test_receiving_multiple_informational_responses | 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_receive_provisional_response_with_end_stream(self,
frame_factory,
end_stream) -> None:
"""
Receiving provisional responses with END_STREAM set causes
ProtocolErrors.
... |
Receiving provisional responses with END_STREAM set causes
ProtocolErrors.
| test_receive_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 |
Subsets and Splits
Django Code with Docstrings
Filters Python code examples from Django repository that contain Django-related code, helping identify relevant code snippets for understanding Django framework usage patterns.
SQL Console for Shuu12121/python-treesitter-filtered-datasetsV2
Retrieves specific code examples from the Flask repository but doesn't provide meaningful analysis or patterns beyond basic data retrieval.
HTTPX Repo Code and Docstrings
Retrieves specific code examples from the httpx repository, which is useful for understanding how particular libraries are used but doesn't provide broader analytical insights about the dataset.
Requests Repo Docstrings & Code
Retrieves code examples with their docstrings and file paths from the requests repository, providing basic filtering but limited analytical value beyond finding specific code samples.
Quart Repo Docstrings & Code
Retrieves code examples with their docstrings from the Quart repository, providing basic code samples but offering limited analytical value for understanding broader patterns or relationships in the dataset.