Beispiel #1
0
 def test_rst_stream_frame_has_no_flags(self):
     f = RstStreamFrame(1)
     flags = f.parse_flags(0xFF)
     assert not flags
     assert isinstance(flags, set)
Beispiel #2
0
    def test_rst_stream_frame_serializes_properly(self):
        f = RstStreamFrame(1)
        f.error_code = 420

        s = f.serialize()
        assert s == b'\x00\x04\x03\x00\x00\x00\x00\x01\x00\x00\x01\xa4'
Beispiel #3
0
    def test_rst_stream_frame_serializes_properly(self):
        f = RstStreamFrame(1)
        f.error_code = 420

        s = f.serialize()
        assert s == b'\x00\x04\x03\x00\x00\x00\x00\x01\x00\x00\x01\xa4'
Beispiel #4
0
 def test_rst_stream_frame_has_no_flags(self):
     f = RstStreamFrame(1)
     flags = f.parse_flags(0xFF)
     assert not flags
     assert isinstance(flags, set)
Beispiel #5
0
 def test_rst_stream_frame_must_have_body_length_four(self):
     f = RstStreamFrame(1)
     with pytest.raises(ValueError):
         f.parse_body(b'\x01')
Beispiel #6
0
 def test_rst_stream_frame_comes_on_a_stream(self):
     with pytest.raises(ValueError):
         RstStreamFrame(0)
Beispiel #7
0
 def test_rst_stream_frame_must_have_body_length_four(self):
     f = RstStreamFrame(1)
     with pytest.raises(ValueError):
         f.parse_body(b"\x01")