diff --git a/tests/test_web_request.py b/tests/test_web_request.py index 9149d1da946..5ba7e34cda9 100644 --- a/tests/test_web_request.py +++ b/tests/test_web_request.py @@ -335,6 +335,29 @@ def test_make_too_big_request_adjust_limit(loop): assert len(txt) == 1024**2 + 1 +@asyncio.coroutine +def test_multipart_formdata(loop): + payload = StreamReader(loop=loop) + payload.feed_data(b"""-----------------------------93831266110166\r +Content-Disposition: form-data; name="a"\r +\r +b\r +-----------------------------93831266110166\r +Content-Disposition: form-data; name="c"\r +\r +d\r +-----------------------------93831266110166--\r\n""") + payload.feed_eof() + req = make_request('POST', '/', + headers= + CIMultiDict( + {'CONTENT-TYPE': + 'multipart/form-data'}), + payload=payload) + result = yield from req.post() + assert result == CIMultiDict({'a':'b', 'c':'d'}) + + @asyncio.coroutine def test_make_too_big_request_limit_None(loop): payload = StreamReader(loop=loop)