MCPcopy
hub / github.com/pallets/werkzeug / test_root_path

Function test_root_path

tests/test_send_file.py:193–205  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

191
192
193def 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
208def test_max_age_callable():

Callers

nothing calls this directly

Calls 3

send_fileFunction · 0.90
send_from_directoryFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected