Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hyperframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class Priority(object):
Mixin for frames that contain priority data. Defines extra fields that can
be used and set by frames that contain priority data.
"""
def __init__(self, stream_id, depends_on=None, stream_weight=None, exclusive=None, **kwargs):
def __init__(self, stream_id, depends_on=0x0, stream_weight=0x0, exclusive=False, **kwargs):
super(Priority, self).__init__(stream_id, **kwargs)

#: The stream ID of the stream on which this stream depends.
Expand Down
5 changes: 5 additions & 0 deletions test/test_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def test_priority_frame_has_no_flags(self):
assert flags == set()
assert isinstance(flags, Flags)

def test_priority_frame_default_serializes_properly(self):
f = PriorityFrame(1)

assert f.serialize() == b'\x00\x00\x05\x02\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00'

def test_priority_frame_with_all_data_serializes_properly(self):
f = PriorityFrame(1)
f.depends_on = 0x04
Expand Down