(self, ending: bytes)
| 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): |
nothing calls this directly
no test coverage detected