MCPcopy
hub / github.com/encode/httpx / test_multiple_headers

Function test_multiple_headers

tests/models/test_headers.py:158–166  ·  view source on GitHub ↗

`Headers.get_list` should support both split_commas=False and split_commas=True.

()

Source from the content-addressed store, hash-verified

156
157
158def test_multiple_headers():
159 """
160 `Headers.get_list` should support both split_commas=False and split_commas=True.
161 """
162 h = httpx.Headers([("set-cookie", "a, b"), ("set-cookie", "c")])
163 assert h.get_list("Set-Cookie") == ["a, b", "c"]
164
165 h = httpx.Headers([("vary", "a, b"), ("vary", "c")])
166 assert h.get_list("Vary", split_commas=True) == ["a", "b", "c"]
167
168
169@pytest.mark.parametrize("header", ["authorization", "proxy-authorization"])

Callers

nothing calls this directly

Calls 1

get_listMethod · 0.95

Tested by

no test coverage detected