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

Function test_object_attachment_requires_name

tests/test_send_file.py:84–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83
84def test_object_attachment_requires_name():
85 with pytest.raises(TypeError, match="attachment"):
86 send_file(
87 io.BytesIO(b"test"), environ, mimetype="text/plain", as_attachment=True
88 )
89
90 rv = send_file(
91 io.BytesIO(b"test"), environ, as_attachment=True, download_name="test.txt"
92 )
93 assert rv.headers["Content-Disposition"] == "attachment; filename=test.txt"
94 rv.close()
95
96
97@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

send_fileFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected