File: test_inbuf_overflow.py

package info (click to toggle)
aiohttp-wsgi 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 236 kB
  • sloc: python: 790; makefile: 19; sh: 8
file content (14 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from tests.base import AsyncTestCase, streaming_request_body, echo_application


class InbufOverflowTest(AsyncTestCase):

    def testInbufOverflow(self) -> None:
        with self.run_server(echo_application, inbuf_overflow=3) as client:
            response = client.request(data="foobar")
            self.assertEqual(response.content, b"foobar")

    def testInbufOverflowStreaming(self) -> None:
        with self.run_server(echo_application, inbuf_overflow=20) as client:
            response = client.request(data=streaming_request_body())
            self.assertEqual(response.content, b"foobar" * 100)