コード例 #1
0
ファイル: test_hyper.py プロジェクト: lifuzu/hyper
 def test_priority_frame_has_no_flags(self):
     f = PriorityFrame(1)
     flags = f.parse_flags(0xFF)
     assert not flags
     assert isinstance(flags, set)
コード例 #2
0
ファイル: test_hyper.py プロジェクト: lifuzu/hyper
    def test_priority_frame_serializes_properly(self):
        f = PriorityFrame(1)
        f.priority = 0xFF

        s = f.serialize()
        assert s == b'\x00\x04\x02\x00\x00\x00\x00\x01\x00\x00\x00\xff'
コード例 #3
0
ファイル: test_hyper.py プロジェクト: ncarlson/hyper
    def test_priority_frame_serializes_properly(self):
        f = PriorityFrame(1)
        f.priority = 0xFF

        s = f.serialize()
        assert s == b'\x00\x04\x02\x00\x00\x00\x00\x01\x00\x00\x00\xff'
コード例 #4
0
ファイル: test_hyper.py プロジェクト: ncarlson/hyper
 def test_priority_frame_has_no_flags(self):
     f = PriorityFrame(1)
     flags = f.parse_flags(0xFF)
     assert not flags
     assert isinstance(flags, set)
コード例 #5
0
ファイル: test_hyper.py プロジェクト: ami-GS/hyper
 def test_priority_frame_must_have_body_length_four(self):
     f = PriorityFrame(1)
     with pytest.raises(ValueError):
         f.parse_body(b'\x01')
コード例 #6
0
ファイル: test_hyper.py プロジェクト: ami-GS/hyper
 def test_priority_frame_comes_on_a_stream(self):
     with pytest.raises(ValueError):
         PriorityFrame(0)
コード例 #7
0
ファイル: test_hyper.py プロジェクト: 4honor/hyper
 def test_priority_frame_must_have_body_length_four(self):
     f = PriorityFrame(1)
     with pytest.raises(ValueError):
         f.parse_body(b"\x01")