Skip to content

Commit 45f71d5

Browse files
committed
make format
1 parent 853b087 commit 45f71d5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/functional/event_handler/_pydantic/test_file_parameter.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Validation constraints
1010
- Mixed file and form data scenarios
1111
"""
12+
1213
import base64
1314
import json
1415
from typing import Annotated
@@ -342,7 +343,7 @@ def upload_file(file: Annotated[bytes, File()]):
342343
"httpMethod": "POST",
343344
"apiId": "abcdefghij",
344345
},
345-
"body": "--test\r\nContent-Disposition: form-data; name=\"other\"\r\n\r\nvalue\r\n--test--",
346+
"body": '--test\r\nContent-Disposition: form-data; name="other"\r\n\r\nvalue\r\n--test--',
346347
"isBase64Encoded": False,
347348
}
348349

@@ -383,7 +384,7 @@ def upload_file(file: Annotated[Union[bytes, None], File()] = None):
383384
"httpMethod": "POST",
384385
"apiId": "abcdefghij",
385386
},
386-
"body": "--test\r\nContent-Disposition: form-data; name=\"other\"\r\n\r\nvalue\r\n--test--",
387+
"body": '--test\r\nContent-Disposition: form-data; name="other"\r\n\r\nvalue\r\n--test--',
387388
"isBase64Encoded": False,
388389
}
389390

@@ -616,21 +617,21 @@ def upload_with_data(
616617
# Create multipart data with invalid UTF-8 in form field
617618
boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW"
618619
invalid_utf8_bytes = b"\xff\xfe\xfd"
619-
620+
620621
body_parts = []
621622
body_parts.append(f"--{boundary}")
622623
body_parts.append('Content-Disposition: form-data; name="file"; filename="test.txt"')
623624
body_parts.append("Content-Type: text/plain")
624625
body_parts.append("")
625626
body_parts.append("File content")
626-
627+
627628
body_parts.append(f"--{boundary}")
628629
body_parts.append('Content-Disposition: form-data; name="metadata"')
629630
body_parts.append("")
630-
631+
631632
body_start = "\r\n".join(body_parts) + "\r\n"
632633
body_end = f"\r\n--{boundary}--"
633-
634+
634635
# Combine with the invalid UTF-8 bytes
635636
full_body = body_start.encode("utf-8") + invalid_utf8_bytes + body_end.encode("utf-8")
636637

@@ -676,7 +677,7 @@ def upload_file(file: Annotated[bytes, File()]):
676677
return {"status": "uploaded"}
677678

678679
webkit_boundary = "WebKitFormBoundary7MA4YWxkTrZu0gW123"
679-
680+
680681
body_lines = [
681682
f"--{webkit_boundary}",
682683
'Content-Disposition: form-data; name="file"; filename="test.txt"',
@@ -724,7 +725,7 @@ def upload_file(file: Annotated[bytes, File()]):
724725
return {"status": "uploaded"}
725726

726727
boundary = "test-boundary-123"
727-
728+
728729
body_lines = [
729730
f"--{boundary}",
730731
'Content-Disposition: form-data; name="file"; filename="test.txt"',

0 commit comments

Comments
 (0)