(tmp_path: Path)
| 254 | |
| 255 | |
| 256 | def test_basic_file_serving(tmp_path: Path): |
| 257 | dist = tmp_path / "dist" |
| 258 | write_file(dist / "assets" / "app.js", "console.log('ok')") |
| 259 | app = FastAPI() |
| 260 | app.frontend("/", directory=dist) |
| 261 | |
| 262 | response = TestClient(app).get("/assets/app.js") |
| 263 | |
| 264 | assert response.status_code == 200 |
| 265 | assert response.text == "console.log('ok')" |
| 266 | assert "etag" in response.headers |
| 267 | assert "last-modified" in response.headers |
| 268 | |
| 269 | |
| 270 | def test_app_frontend_dependencies_protect_root_asset_and_fallback(tmp_path: Path): |
nothing calls this directly
no test coverage detected
searching dependent graphs…