()
| 39 | |
| 40 | |
| 41 | def 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 | |
| 52 | def test_url_encoded_data(): |