(tmp_path: Path, test_client_factory: TestClientFactory)
| 334 | |
| 335 | |
| 336 | def test_file_response_with_inline_disposition(tmp_path: Path, test_client_factory: TestClientFactory) -> None: |
| 337 | content = b"file content" |
| 338 | filename = "hello.txt" |
| 339 | path = tmp_path / filename |
| 340 | path.write_bytes(content) |
| 341 | app = FileResponse(path=path, filename=filename, content_disposition_type="inline") |
| 342 | client = test_client_factory(app) |
| 343 | response = client.get("/") |
| 344 | expected_disposition = 'inline; filename="hello.txt"' |
| 345 | assert response.status_code == status.HTTP_200_OK |
| 346 | assert response.content == content |
| 347 | assert response.headers["content-disposition"] == expected_disposition |
| 348 | |
| 349 | |
| 350 | def test_file_response_with_range_header(tmp_path: Path, test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected