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

Commit 0a7c957

Browse files
committed
Extra headers test: non-strings.
1 parent 57cd931 commit 0a7c957

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_headers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,14 @@ def test_raw_iteration(self):
214214
h = HTTPHeaderMap(items)
215215

216216
assert list(h.iter_raw()) == items
217+
218+
def test_headers_must_be_strings(self):
219+
with pytest.raises(ValueError):
220+
HTTPHeaderMap(key=1)
221+
222+
h = HTTPHeaderMap()
223+
with pytest.raises(ValueError):
224+
h['k'] = 1
225+
226+
with pytest.raises(ValueError):
227+
h[1] = 'v'

0 commit comments

Comments
 (0)