def test_priority_frame_with_all_data_serializes_properly(self): f = PriorityFrame(1) f.depends_on = 0x04 f.stream_weight = 64 f.exclusive = True assert f.serialize() == self.payload
def test_repr(self): f = PriorityFrame(1) assert repr(f).endswith( "exclusive=False, depends_on=0, stream_weight=0") f.exclusive = True f.depends_on = 0x04 f.stream_weight = 64 assert repr(f).endswith( "exclusive=True, depends_on=4, stream_weight=64")
def build_priority_frame(self, stream_id, weight, depends_on=0, exclusive=False): """ Builds a single priority frame. """ f = PriorityFrame(stream_id) f.depends_on = depends_on f.stream_weight = weight f.exclusive = exclusive return f