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

Commit bf0bfdb

Browse files
committed
check the opaque_data of ping frame
1 parent fc7e8db commit bf0bfdb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_hyper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
combine_repeated_headers, split_repeated_headers, h2_safe_headers
1616
)
1717
from hyper.common.headers import HTTPHeaderMap
18+
from hyper.common.util import to_bytestring
1819
from hyper.compat import zlib_compressobj, is_py2
1920
from hyper.contrib import HTTP20Adapter
2021
import hyper.http20.errors as errors
@@ -87,12 +88,14 @@ def data_callback(chunk, **kwargs):
8788
c = HTTP20Connection('www.google.com')
8889
c._sock = DummySocket()
8990
c._send_cb = data_callback
90-
c.ping('00000000')
91+
opaque = '00000000'
92+
c.ping(opaque)
9193

9294
frames = list(frame_buffer)
9395
assert len(frames) == 1
9496
f = frames[0]
9597
assert isinstance(f, PingFrame)
98+
assert f.opaque_data == to_bytestring(opaque)
9699

97100
def test_putrequest_establishes_new_stream(self):
98101
c = HTTP20Connection("www.google.com")

0 commit comments

Comments
 (0)