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

Function test_environ_builder_stream_switch

tests/test_test.py:318–334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316
317
318def test_environ_builder_stream_switch():
319 d = MultiDict(dict(foo="bar", blub="blah", hu="hum"))
320 for use_tempfile in False, True:
321 stream, length, boundary = stream_encode_multipart(
322 d, use_tempfile, threshold=150
323 )
324 assert isinstance(stream, BytesIO) != use_tempfile
325
326 form = parse_form_data(
327 {
328 "wsgi.input": stream,
329 "CONTENT_LENGTH": str(length),
330 "CONTENT_TYPE": f'multipart/form-data; boundary="{boundary}"',
331 }
332 )[1]
333 assert form == d
334 stream.close()
335
336
337def test_environ_builder_unicode_file_mix():

Callers

nothing calls this directly

Calls 4

MultiDictClass · 0.90
stream_encode_multipartFunction · 0.90
parse_form_dataFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…