Fix #1318
This commit is contained in:
parent
d187942eeb
commit
68a1e41286
@ -764,7 +764,7 @@ class ResponseObject(_TemplateEnvironmentMixin):
|
|||||||
return FakeTagging()
|
return FakeTagging()
|
||||||
|
|
||||||
def _tagging_from_xml(self, xml):
|
def _tagging_from_xml(self, xml):
|
||||||
parsed_xml = xmltodict.parse(xml)
|
parsed_xml = xmltodict.parse(xml, force_list={'Tag': True})
|
||||||
|
|
||||||
tags = []
|
tags = []
|
||||||
for tag in parsed_xml['Tagging']['TagSet']['Tag']:
|
for tag in parsed_xml['Tagging']['TagSet']['Tag']:
|
||||||
|
@ -1775,6 +1775,30 @@ def test_boto3_put_object_tagging():
|
|||||||
resp['ResponseMetadata']['HTTPStatusCode'].should.equal(200)
|
resp['ResponseMetadata']['HTTPStatusCode'].should.equal(200)
|
||||||
|
|
||||||
|
|
||||||
|
@mock_s3
|
||||||
|
def test_boto3_put_object_tagging_with_single_tag():
|
||||||
|
s3 = boto3.client('s3', region_name='us-east-1')
|
||||||
|
bucket_name = 'mybucket'
|
||||||
|
key = 'key-with-tags'
|
||||||
|
s3.create_bucket(Bucket=bucket_name)
|
||||||
|
|
||||||
|
s3.put_object(
|
||||||
|
Bucket=bucket_name,
|
||||||
|
Key=key,
|
||||||
|
Body='test'
|
||||||
|
)
|
||||||
|
|
||||||
|
resp = s3.put_object_tagging(
|
||||||
|
Bucket=bucket_name,
|
||||||
|
Key=key,
|
||||||
|
Tagging={'TagSet': [
|
||||||
|
{'Key': 'item1', 'Value': 'foo'}
|
||||||
|
]}
|
||||||
|
)
|
||||||
|
|
||||||
|
resp['ResponseMetadata']['HTTPStatusCode'].should.equal(200)
|
||||||
|
|
||||||
|
|
||||||
@mock_s3
|
@mock_s3
|
||||||
def test_boto3_get_object_tagging():
|
def test_boto3_get_object_tagging():
|
||||||
s3 = boto3.client('s3', region_name='us-east-1')
|
s3 = boto3.client('s3', region_name='us-east-1')
|
||||||
|
Loading…
Reference in New Issue
Block a user