Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hubo1016 committed Mar 23, 2017
1 parent 1438fc3 commit f48499c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f48499c

Please sign in to comment.