File: test_request.py

package info (click to toggle)
python-quart-trio 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: python: 984; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
import pytest
from werkzeug.exceptions import RequestEntityTooLarge

from quart_trio.wrappers.request import TrioBody


@pytest.mark.trio
async def test_body_exceeds_max_content_length() -> None:
    max_content_length = 5
    body = TrioBody(None, max_content_length)
    body.append(b" " * (max_content_length + 1))
    with pytest.raises(RequestEntityTooLarge):
        await body