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