MCPcopy Create free account
hub / github.com/pallets/quart / test_files

Function test_files

tests/test_testing.py:241–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239
240
241async def test_files() -> None:
242 app = Quart(__name__)
243
244 @app.route("/", methods=["POST"])
245 async def echo() -> Response:
246 files = await request.files
247 data = files["file"].read()
248 return data
249
250 client = Client(app)
251 response = await client.post(
252 "/", files={"file": FileStorage(BytesIO(b"bar"), filename="a.txt")}
253 )
254 assert (await response.get_data(as_text=True)) == "bar"
255
256
257async def test_data() -> None:

Callers

nothing calls this directly

Calls 4

QuartClass · 0.90
FileStorageClass · 0.90
postMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…