Skip to content

Commit

Permalink
Add tests for covering all modified code (aio-libs#4630)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdxmr committed Jul 1, 2020
1 parent 212a64c commit 3afa789
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_http_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,27 @@ async def test_parse_chunked_payload_split_end_trailers2(self,
assert out.is_eof()
assert b'asdf' == b''.join(out._buffer)

async def test_parse_chunked_payload_split_end_trailers3(self,
protocol) -> None:
out = aiohttp.StreamReader(protocol, loop=None)
p = HttpPayloadParser(out, chunked=True)
p.feed_data(b'4\r\nasdf\r\n0\r\nContent-MD5: ')
p.feed_data(b'912ec803b2ce49e4a541068d495ab570\r\n\r\n')

assert out.is_eof()
assert b'asdf' == b''.join(out._buffer)

async def test_parse_chunked_payload_split_end_trailers4(self,
protocol) -> None:
out = aiohttp.StreamReader(protocol, loop=None)
p = HttpPayloadParser(out, chunked=True)
p.feed_data(b'4\r\nasdf\r\n0\r\n'
b'C')
p.feed_data(b'ontent-MD5: 912ec803b2ce49e4a541068d495ab570\r\n\r\n')

assert out.is_eof()
assert b'asdf' == b''.join(out._buffer)

async def test_http_payload_parser_length(self, stream) -> None:
out = aiohttp.FlowControlDataQueue(stream,
loop=asyncio.get_event_loop())
Expand Down

0 comments on commit 3afa789

Please sign in to comment.