Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurdarcet committed Jan 9, 2017
1 parent c218ed7 commit 14f6fed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from aiohttp.helpers import parse_mimetype
from aiohttp.multipart import (content_disposition_filename,
parse_content_disposition)
from aiohttp.streams import StreamReader
from aiohttp.streams import DEFAULT_LIMIT as stream_reader_default_limit


def run_in_loop(f):
Expand Down Expand Up @@ -498,6 +500,16 @@ def test_filename(self):
None)
self.assertEqual('foo.html', part.filename)

def test_reading_long_part(self):
size = 2 * stream_reader_default_limit
stream = StreamReader()
stream.feed_data(b'0' * size + b'\r\n--:--')
stream.feed_eof()
obj = aiohttp.multipart.BodyPartReader(
self.boundary, {}, stream)
data = yield from obj.read()
self.assertEqual(len(data), size)


class MultipartReaderTestCase(TestCase):

Expand Down

0 comments on commit 14f6fed

Please sign in to comment.