

def test_headers_with_priority_info(self, frame_factory):
    '\n        Receiving a HEADERS frame with priority information on it emits a\n        PriorityUpdated event.\n        '
    c = h2.connection.H2Connection(client_side=False)
    frame_factory.initiate_connection()
    c.receive_data(frame_factory.preamble())
    c.clear_outbound_data_buffer()
    f = frame_factory.build_headers_frame(headers=self.example_request_headers, stream_id=3, flags=['PRIORITY'], stream_weight=15, depends_on=1, exclusive=True)
    events = c.receive_data(f.serialize())
    assert (len(events) == 2)
    assert (not c.data_to_send())
    event = events[1]
    assert isinstance(event, h2.events.PriorityUpdated)
    assert (event.stream_id == 3)
    assert (event.depends_on == 1)
    assert (event.weight == 16)
    assert (event.exclusive is True)

dataset/ETHPy150Open python-hyper/hyper-h2/test/test_priority.py TestPriority.test_headers_with_priority_info/VarMisuse@27/73 `c`->`frame_factory`