(tmp_path)
| 191 | |
| 192 | |
| 193 | def test_root_path(tmp_path): |
| 194 | # This is a private API, it should only be used by Flask. |
| 195 | d = tmp_path / "d" |
| 196 | d.mkdir() |
| 197 | (d / "test.txt").write_bytes(b"test") |
| 198 | rv = send_file("d/test.txt", environ, _root_path=tmp_path) |
| 199 | rv.direct_passthrough = False |
| 200 | assert rv.data == b"test" |
| 201 | rv.close() |
| 202 | rv = send_from_directory("d", "test.txt", environ, _root_path=tmp_path) |
| 203 | rv.direct_passthrough = False |
| 204 | assert rv.data == b"test" |
| 205 | rv.close() |
| 206 | |
| 207 | |
| 208 | def test_max_age_callable(): |
nothing calls this directly
no test coverage detected