Skip to content

Commit c2455f9

Browse files
committed
fix(multipart): fix lint issues, remove tabs, add missing import, and clean comment
1 parent f054af4 commit c2455f9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/unit/test_multipart_413.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
import pytest
2-
from litestar import Litestar
3-
from litestar.exceptions import HTTPException
2+
from litestar import Litestar, post
43
from starlette.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE
54
from litestar.testing import create_test_client
65

7-
# Define a proper handler at module level
6+
@post("/upload")
87
async def upload_handler(data):
98
return {"success": True}
109

1110
@pytest.mark.anyio
1211
async def test_oversized_file_returns_413():
1312
app = Litestar(
1413
route_handlers=[upload_handler],
15-
multipart_form_part_limit=10, # Small limit to trigger the error
14+
multipart_form_part_limit=10, # small limit to trigger the error
1615
)
1716

1817
async with create_test_client(app) as client:
19-
response = await client.post("/upload", data={"file": "x" * 100}) # Example oversized data
18+
response = await client.post("/upload", data={"file": "x" * 100})
2019
assert response.status_code == HTTP_413_REQUEST_ENTITY_TOO_LARGE

0 commit comments

Comments
 (0)