Skip to content

Commit 9b9f7bc

Browse files
committed
move requests to optional. change copyright name in new test file. add timeouts to python_requests.post.
1 parent 1eaa1a8 commit 9b9f7bc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

optional_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
4+
5+
requests

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44

55
Adafruit-Blinka
66
Adafruit-Circuitpython-ConnectionManager
7-
requests

tests/files_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2024 Justin Myers
22
#
33
# SPDX-License-Identifier: Unlicense
44

5-
""" Post Tests """
5+
""" Post Files Tests """
66
# pylint: disable=line-too-long
77

88
import re
@@ -53,7 +53,7 @@ def get_actual_request_data(log_stream):
5353
if "Content-Disposition" in log_arg:
5454
# this will look like:
5555
# b\'{content}\'
56-
# and escapped characters look like:
56+
# and escaped characters look like:
5757
# \\r
5858
post_data = log_arg[2:-1]
5959
post_bytes = post_data.encode("utf-8")
@@ -70,7 +70,7 @@ def test_post_files_text( # pylint: disable=unused-argument
7070
"key_4": (None, "Value 5"),
7171
}
7272

73-
python_requests.post(post_url, files=file_data)
73+
python_requests.post(post_url, files=file_data, timeout=30)
7474
boundary, content_length, actual_request_post = get_actual_request_data(log_stream)
7575

7676
requests._build_boundary_string = mock.Mock(return_value=boundary)
@@ -115,7 +115,7 @@ def test_post_files_file( # pylint: disable=unused-argument
115115
),
116116
}
117117

118-
python_requests.post(post_url, files=file_data)
118+
python_requests.post(post_url, files=file_data, timeout=30)
119119
boundary, content_length, actual_request_post = get_actual_request_data(
120120
log_stream
121121
)
@@ -170,7 +170,7 @@ def test_post_files_complex( # pylint: disable=unused-argument
170170
"key_6": (None, "Value 6"),
171171
}
172172

173-
python_requests.post(post_url, files=file_data)
173+
python_requests.post(post_url, files=file_data, timeout=30)
174174
boundary, content_length, actual_request_post = get_actual_request_data(
175175
log_stream
176176
)

0 commit comments

Comments
 (0)