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

Function test_environ_builder_empty_file

tests/test_test.py:361–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

359
360
361def test_environ_builder_empty_file():
362 f = FileStorage(BytesIO(rb""), "empty.txt")
363 d = MultiDict(dict(f=f, s=""))
364 stream, length, boundary = stream_encode_multipart(d)
365 _, form, files = parse_form_data(
366 {
367 "wsgi.input": stream,
368 "CONTENT_LENGTH": str(length),
369 "CONTENT_TYPE": f'multipart/form-data; boundary="{boundary}"',
370 }
371 )
372 assert form["s"] == ""
373 assert files["f"].read() == rb""
374 stream.close()
375 files["f"].close()
376
377
378def test_create_environ():

Callers

nothing calls this directly

Calls 6

FileStorageClass · 0.90
MultiDictClass · 0.90
stream_encode_multipartFunction · 0.90
parse_form_dataFunction · 0.90
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected