(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({class="st">"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 bclass="st">"foo" |
| 499 | yield bclass="st">"bar" |
| 500 | |
| 501 | response = client.post(class="st">"/", data=post_body()) class="cm"># type: ignore |
| 502 | assert response.json() == {class="st">"body": class="st">"foobar"} |
| 503 | |
| 504 | |
| 505 | def test_request_send_push_promise(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected