Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 79543f8

Browse files
committed
Test PING frames better.
1 parent b1df958 commit 79543f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_hyper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ def test_ping_frame_parses_properly(self):
231231
assert f.flags == set(['ACK'])
232232
assert f.opaque_data == b'\x01\x02\x00\x00\x00\x00\x00\x00'
233233

234+
def test_ping_frame_never_has_a_stream(self):
235+
with pytest.raises(ValueError):
236+
PingFrame(1)
237+
238+
def test_ping_frame_has_no_more_than_body_length_8(self):
239+
f = PingFrame(0)
240+
with pytest.raises(ValueError):
241+
f.parse_body(b'\x01\x02\x03\x04\x05\x06\x07\x08\x09')
242+
234243

235244
class TestGoAwayFrame(object):
236245
def test_go_away_has_no_flags(self):

0 commit comments

Comments
 (0)