(file_factory)
| 45 | "file_factory", [lambda: txt_path.open("rb"), lambda: io.BytesIO(b"test")] |
| 46 | ) |
| 47 | def test_object(file_factory): |
| 48 | rv = send_file(file_factory(), environ, mimetype="text/plain", use_x_sendfile=True) |
| 49 | rv.direct_passthrough = False |
| 50 | assert rv.data |
| 51 | assert rv.mimetype == "text/plain" |
| 52 | assert "x-sendfile" not in rv.headers |
| 53 | rv.close() |
| 54 | |
| 55 | |
| 56 | def test_object_without_mimetype(): |