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

Method test_nonstandard_line_endings

tests/test_formparser.py:410–431  ·  view source on GitHub ↗
(self, ending: bytes)

Source from the content-addressed store, hash-verified

408
409 @pytest.mark.parametrize("ending", [b"\n", b"\r", b"\r\n"])
410 def test_nonstandard_line_endings(self, ending: bytes):
411 data = ending.join(
412 (
413 b"--foo",
414 b"Content-Disposition: form-data; name=foo",
415 b"",
416 b"this is just bar",
417 b"--foo",
418 b"Content-Disposition: form-data; name=bar",
419 b"",
420 b"blafasel",
421 b"--foo--",
422 )
423 )
424 req = Request.from_values(
425 input_stream=io.BytesIO(data),
426 content_length=len(data),
427 content_type="multipart/form-data; boundary=foo",
428 method="POST",
429 )
430 assert req.form["foo"] == "this is just bar"
431 assert req.form["bar"] == "blafasel"
432
433 def test_failures(self):
434 def parse_multipart(stream, boundary, content_length):

Callers

nothing calls this directly

Calls 1

from_valuesMethod · 0.80

Tested by

no test coverage detected