(tmp_path: Path, test_client_factory: TestClientFactory)
| 579 | |
| 580 | |
| 581 | def test_file_response_known_size(tmp_path: Path, test_client_factory: TestClientFactory) -> None: |
| 582 | path = tmp_path / "xyz" |
| 583 | content = b"<file content>" * 1000 |
| 584 | path.write_bytes(content) |
| 585 | |
| 586 | app = FileResponse(path=path, filename="example.png") |
| 587 | client: TestClient = test_client_factory(app) |
| 588 | response = client.get("/") |
| 589 | assert response.headers["content-length"] == str(len(content)) |
| 590 | |
| 591 | |
| 592 | def test_streaming_response_unknown_size( |
nothing calls this directly
no test coverage detected