MCPcopy
hub / github.com/pallets/flask / test_send_file

Method test_send_file

tests/test_helpers.py:34–43  ·  view source on GitHub ↗
(self, app, req_ctx)

Source from the content-addressed store, hash-verified

32
33class TestSendfile:
34 def test_send_file(self, app, req_ctx):
35 rv = flask.send_file("static/index.html")
36 assert rv.direct_passthrough
37 assert rv.mimetype == "text/html"
38
39 with app.open_resource("static/index.html") as f:
40 rv.direct_passthrough = False
41 assert rv.data == f.read()
42
43 rv.close()
44
45 def test_static_file(self, app, req_ctx):
46 # Default max_age is None.

Callers

nothing calls this directly

Calls 2

closeMethod · 0.80
open_resourceMethod · 0.45

Tested by

no test coverage detected