Skip to content

Commit 99a62fe

Browse files
DiamondJosephdanielballan
authored andcommitted
fix: More Minio breaking changes
1 parent c22cf07 commit 99a62fe

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

tiled/_tests/conftest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def minio_uri():
322322

323323
# For convenience, we split the bucket from a string
324324
url = urlparse(uri)
325-
bucket = url.path.lstrip("/")
325+
bucket_name = url.path.lstrip("/")
326326
uri = url._replace(netloc="{}:{}".format(url.hostname, url.port), path="")
327327

328328
client = Minio(
@@ -333,16 +333,18 @@ def minio_uri():
333333
)
334334

335335
# Reset the state of the bucket after each test.
336-
if client.bucket_exists(bucket):
336+
if client.bucket_exists(bucket_name=bucket_name):
337337
delete_object_list = map(
338-
lambda x: DeleteObject(x.object_name),
339-
client.list_objects(bucket, recursive=True),
338+
lambda x: DeleteObject(object_name=x.object_name),
339+
client.list_objects(bucket_name=bucket_name, recursive=True),
340+
)
341+
errors = client.remove_objects(
342+
bucket_name=bucket_name, delete_object_list=delete_object_list
340343
)
341-
errors = client.remove_objects(bucket, delete_object_list)
342344
for error in errors:
343345
print("error occurred when deleting object", error)
344346
else:
345-
client.make_bucket(bucket_name=bucket)
347+
client.make_bucket(bucket_name=bucket_name)
346348

347349
else:
348350
raise pytest.skip("No TILED_TEST_BUCKET configured")

tiled/_tests/test_writing.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ def tmp_minio_bucket():
6969
finally:
7070
# Cleanup: remove all objects and delete the bucket
7171
try:
72-
objects = minio_client.list_objects(bucket_name, recursive=True)
72+
objects = minio_client.list_objects(
73+
bucket_name=bucket_name, recursive=True
74+
)
7375
for obj in objects:
74-
minio_client.remove_object(bucket_name, obj.object_name)
75-
minio_client.remove_bucket(bucket_name)
76+
minio_client.remove_object(
77+
bucket_name=bucket_name, object_name=obj.object_name
78+
)
79+
minio_client.remove_bucket(bucket_name=bucket_name)
7680
except S3Error as e:
7781
print(f"Warning: failed to delete test bucket {bucket_name}: {e}")
7882

0 commit comments

Comments
 (0)