from pathlib import Path
from typing import Any, cast

from fastapi.testclient import TestClient

from docs_src.custom_response import tutorial008_py310
from docs_src.custom_response.tutorial008_py310 import app

client = TestClient(app)


def test_get(tmp_path: Path):
    file_path: Path = tmp_path / "large-video-file.mp4"
    cast(Any, tutorial008_py310).some_file_path = str(file_path)
    test_content = b"Fake video bytes"
    file_path.write_bytes(test_content)
    response = client.get("/")
    assert response.content == test_content
