Skip to content

Commit 5bce61e

Browse files
Increase coverage for s3.delete* (#1897)
1 parent bb208bd commit 5bce61e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_s3.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ def test_list_by_last_modified_date(path):
6969
assert len(wr.s3.read_json(path, last_modified_begin=begin_utc, last_modified_end=end_utc).index) == 6
7070

7171

72+
@pytest.mark.parametrize("use_threads", [True, False])
73+
def test_delete_objects_multiple_chunks(bucket: str, path: str, use_threads: bool) -> None:
74+
df = pd.DataFrame({"FooBoo": [1, 2, 3]})
75+
76+
file_paths = [f"{path}data.csv{i}" for i in range(10)]
77+
for file_path in file_paths:
78+
wr.s3.to_csv(df, file_path)
79+
80+
with patch("awswrangler._utils.chunkify") as chunkify_function:
81+
chunkify_function.return_value = [[p] for p in file_paths]
82+
wr.s3.delete_objects(path=file_paths, use_threads=use_threads)
83+
84+
7285
def test_delete_internal_error(bucket):
7386
response = {
7487
"Errors": [

0 commit comments

Comments
 (0)