Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeleteObjects: ensure 400 MalformedXML is returned for empty list #598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions s3tests_boto3/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,22 @@ def test_multi_object_delete():
response = client.list_objects(Bucket=bucket_name)
assert 'Contents' not in response

def test_multi_object_delete_empty_list():
bucket_name = get_new_bucket()
client = get_client()

e = assert_raises(ClientError, client.delete_objects, Bucket=bucket_name, Delete={'Objects': [], 'Quiet': False})
status = _get_status(e.response)
assert status == 400

def test_multi_object_delete_empty_list_access_forbidden():
bucket_name = get_new_bucket()
alt_client = get_alt_client()

e = assert_raises(ClientError, alt_client.delete_objects, Bucket=bucket_name, Delete={'Objects': [], 'Quiet': False})
status = _get_status(e.response)
assert status == 400

@pytest.mark.list_objects_v2
def test_multi_objectv2_delete():
key_names = ['key0', 'key1', 'key2']
Expand Down