

def test_receiving_priority_emits_priority_update(self, frame_factory):
    '\n        Receiving a priority frame emits a PriorityUpdated event.\n        '
    c = h2.connection.H2Connection(client_side=False)
    c.initiate_connection()
    c.receive_data(frame_factory.preamble())
    c.clear_outbound_data_buffer()
    f = frame_factory.build_priority_frame(stream_id=1, weight=255)
    events = c.receive_data(f.serialize())
    assert (len(events) == 1)
    assert (not c.data_to_send())
    event = events[0]
    assert isinstance(event, h2.events.PriorityUpdated)
    assert (event.stream_id == 1)
    assert (event.depends_on == 0)
    assert (event.weight == 256)
    assert (event.exclusive is False)

dataset/ETHPy150Open python-hyper/hyper-h2/test/test_priority.py TestPriority.test_receiving_priority_emits_priority_update/original