Test split into boto and boto3 part

This commit is contained in:
Mariusz Strzelecki 2019-07-23 20:53:45 +02:00
parent f32db6e64a
commit 51d96ae8f3

View File

@ -639,7 +639,7 @@ def test_delete_keys():
@mock_s3_deprecated @mock_s3_deprecated
def test_delete_keys_with_invalid(): def test_delete_keys_invalid():
conn = boto.connect_s3('the_key', 'the_secret') conn = boto.connect_s3('the_key', 'the_secret')
bucket = conn.create_bucket('foobar') bucket = conn.create_bucket('foobar')
@ -657,13 +657,14 @@ def test_delete_keys_with_invalid():
keys.should.have.length_of(3) keys.should.have.length_of(3)
keys[0].name.should.equal('file1') keys[0].name.should.equal('file1')
# empty keys and boto2 client # empty keys
result = bucket.delete_keys([]) result = bucket.delete_keys([])
result.deleted.should.have.length_of(0) result.deleted.should.have.length_of(0)
result.errors.should.have.length_of(0) result.errors.should.have.length_of(0)
# empty keys and boto3 client @mock_s3
def test_boto3_delete_empty_keys_list():
with assert_raises(ClientError) as err: with assert_raises(ClientError) as err:
boto3.client('s3').delete_objects(Bucket='foobar', Delete={'Objects': []}) boto3.client('s3').delete_objects(Bucket='foobar', Delete={'Objects': []})
assert err.exception.response["Error"]["Code"] == "MalformedXML" assert err.exception.response["Error"]["Code"] == "MalformedXML"