1
- # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
1
+ # SPDX-FileCopyrightText: 2024 Justin Myers
2
2
#
3
3
# SPDX-License-Identifier: Unlicense
4
4
5
- """ Post Tests """
5
+ """ Post Files Tests """
6
6
# pylint: disable=line-too-long
7
7
8
8
import re
@@ -53,7 +53,7 @@ def get_actual_request_data(log_stream):
53
53
if "Content-Disposition" in log_arg :
54
54
# this will look like:
55
55
# b\'{content}\'
56
- # and escapped characters look like:
56
+ # and escaped characters look like:
57
57
# \\r
58
58
post_data = log_arg [2 :- 1 ]
59
59
post_bytes = post_data .encode ("utf-8" )
@@ -70,7 +70,7 @@ def test_post_files_text( # pylint: disable=unused-argument
70
70
"key_4" : (None , "Value 5" ),
71
71
}
72
72
73
- python_requests .post (post_url , files = file_data )
73
+ python_requests .post (post_url , files = file_data , timeout = 30 )
74
74
boundary , content_length , actual_request_post = get_actual_request_data (log_stream )
75
75
76
76
requests ._build_boundary_string = mock .Mock (return_value = boundary )
@@ -115,7 +115,7 @@ def test_post_files_file( # pylint: disable=unused-argument
115
115
),
116
116
}
117
117
118
- python_requests .post (post_url , files = file_data )
118
+ python_requests .post (post_url , files = file_data , timeout = 30 )
119
119
boundary , content_length , actual_request_post = get_actual_request_data (
120
120
log_stream
121
121
)
@@ -170,7 +170,7 @@ def test_post_files_complex( # pylint: disable=unused-argument
170
170
"key_6" : (None , "Value 6" ),
171
171
}
172
172
173
- python_requests .post (post_url , files = file_data )
173
+ python_requests .post (post_url , files = file_data , timeout = 30 )
174
174
boundary , content_length , actual_request_post = get_actual_request_data (
175
175
log_stream
176
176
)
0 commit comments