Skip to content

Commit 3789435

Browse files
committed
add test for full coverage
1 parent e574f0d commit 3789435

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_hpack.py

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
from hpack.hpack import _dict_to_iterable, _to_bytes
1919

2020

21+
def test_to_bytes():
22+
assert _to_bytes(b"foobar") == b"foobar"
23+
assert _to_bytes("foobar") == b"foobar"
24+
assert _to_bytes(0xABADBABE) == b'2880289470'
25+
assert _to_bytes(True) == b'True'
26+
assert _to_bytes(Encoder()).startswith(b"<hpack.hpack.Encoder")
27+
28+
2129
class TestHPACKEncoder:
2230
# These tests are stolen entirely from the IETF specification examples.
2331
def test_literal_header_field_with_indexing(self):

0 commit comments

Comments
 (0)