Skip to content

Commit ec61e73

Browse files
committed
test(packages): update tests for downloading with response iterator
Adapted the existing tests for the new iterator=True argument
1 parent 8580a77 commit ec61e73

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/functional/api/test_packages.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def test_stream_generic_package(project):
5353
package_name=package_name,
5454
package_version=package_version,
5555
file_name=file_name,
56-
streamed=True,
57-
action="iterator",
56+
iterator=True,
5857
)
5958

6059
assert isinstance(bytes_iterator, Iterator)
@@ -90,8 +89,7 @@ def test_stream_generic_package_to_file(tmp_path, project):
9089
package_name=package_name,
9190
package_version=package_version,
9291
file_name=file_name,
93-
streamed=True,
94-
action="iterator",
92+
iterator=True,
9593
)
9694

9795
with open(path, "wb") as f:

tests/unit/test_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def test_response_content(capsys):
3636
)
3737

3838
resp = requests.get("https://example.com", stream=True)
39-
utils.response_content(resp, streamed=True, action=None, chunk_size=1024)
39+
utils.response_content(
40+
resp, streamed=True, iterator=False, action=None, chunk_size=1024
41+
)
4042

4143
captured = capsys.readouterr()
4244
assert "test" in captured.out

0 commit comments

Comments
 (0)