Coverage for tests/test_tutorial/test_custom_response/test_tutorial008.py: 100%
12 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
1from pathlib import Path 1abcdefg
3from fastapi.testclient import TestClient 1abcdefg
5from docs_src.custom_response import tutorial008 1abcdefg
6from docs_src.custom_response.tutorial008 import app 1abcdefg
8client = TestClient(app) 1abcdefg
11def test_get(tmp_path: Path): 1abcdefg
12 file_path: Path = tmp_path / "large-video-file.mp4" 1hijklmn
13 tutorial008.some_file_path = str(file_path) 1hijklmn
14 test_content = b"Fake video bytes" 1hijklmn
15 file_path.write_bytes(test_content) 1hijklmn
16 response = client.get("/") 1hijklmn
17 assert response.content == test_content 1hijklmn