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

Function test_generator_with_content_length_header

tests/models/test_requests.py:41–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def test_generator_with_content_length_header():
42 def content() -> typing.Iterator[bytes]:
43 yield b"test 123" # pragma: no cover
44
45 headers = {"Content-Length": "8"}
46 request = httpx.Request(
47 "POST", "http://example.org", content=content(), headers=headers
48 )
49 assert request.headers == {"Host": "example.org", "Content-Length": "8"}
50
51
52def test_url_encoded_data():

Callers

nothing calls this directly

Calls 1

contentFunction · 0.70

Tested by

no test coverage detected