Coverage for tests / test_tutorial / test_custom_response / test_tutorial009b.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-04-06 01:24 +0000

1from pathlib import Path 1abcd

2 

3from fastapi.testclient import TestClient 1abcd

4 

5from docs_src.custom_response import tutorial009b_py310 1abcd

6from docs_src.custom_response.tutorial009b_py310 import app 1abcd

7 

8client = TestClient(app) 1abcd

9 

10 

11def test_get(tmp_path: Path): 1abcd

12 file_path: Path = tmp_path / "large-video-file.mp4" 1efgh

13 tutorial009b_py310.some_file_path = str(file_path) 1efgh

14 test_content = b"Fake video bytes" 1efgh

15 file_path.write_bytes(test_content) 1efgh

16 response = client.get("/") 1efgh

17 assert response.content == test_content 1efgh