(test_client_factory: TestClientFactory)
| 486 | |
| 487 | |
| 488 | def test_chunked_encoding(test_client_factory: TestClientFactory) -> None: |
| 489 | async def app(scope: Scope, receive: Receive, send: Send) -> None: |
| 490 | request = Request(scope, receive) |
| 491 | body = await request.body() |
| 492 | response = JSONResponse({"body": body.decode()}) |
| 493 | await response(scope, receive, send) |
| 494 | |
| 495 | client = test_client_factory(app) |
| 496 | |
| 497 | def post_body() -> Iterator[bytes]: |
| 498 | yield b"foo" |
| 499 | yield b"bar" |
| 500 | |
| 501 | response = client.post("/", data=post_body()) # type: ignore |
| 502 | assert response.json() == {"body": "foobar"} |
| 503 | |
| 504 | |
| 505 | def test_request_send_push_promise(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected