diff --git a/botocore/parameters.py b/botocore/parameters.py index 7e6320608a..bc3972199d 100644 --- a/botocore/parameters.py +++ b/botocore/parameters.py @@ -406,7 +406,7 @@ def to_xml(self, value, label=None): return inner_xml else: if not label: - label = self.xmlname + label = self.xmlname or self.name return '<%s>' % label + inner_xml + '' % label diff --git a/tests/unit/test_route53_operations.py b/tests/unit/test_route53_operations.py index 1c18df81ad..ea798e3f1c 100644 --- a/tests/unit/test_route53_operations.py +++ b/tests/unit/test_route53_operations.py @@ -20,10 +20,13 @@ CREATE_RRSET_PAYLOAD="""Adding TXT recordCREATEmidocs.comTXT600"v=foobar"""" DELETE_RRSET_PAYLOAD="""Adding TXT recordDELETEmidocs.comTXT600"v=foobar"""" CREATE_HEALTH_CHECK_PAYLOAD="""foobar192.168.10.08888HTTPfoo/barfoobar.com""" +CHANGE_TAGS_FOR_RESOURCE_PAYLOAD = """keynamevaluename""" class TestRoute53Operations(BaseSessionTest): + maxDiff = None + def setUp(self): super(TestRoute53Operations, self).setUp() self.environ['AWS_ACCESS_KEY_ID'] = 'foo' @@ -38,7 +41,6 @@ def test_create_hosted_zone(self): params = op.build_parameters(name=self.hosted_zone_name, caller_reference='foobar', hosted_zone_config=hzc) - self.maxDiff = None self.assertEqual(params['payload'].getvalue(), CREATE_HOSTED_ZONE_PAYLOAD) @@ -54,7 +56,6 @@ def test_create_resource_record_sets(self): {"Value":"\"v=foobar\""}]}}]} params = op.build_parameters(hosted_zone_id='1111', change_batch=batch) - self.maxDiff = None self.assertEqual(params['payload'].getvalue(), CREATE_RRSET_PAYLOAD) @@ -70,7 +71,6 @@ def test_delete_resource_record_sets(self): {"Value":"\"v=foobar\""}]}}]} params = op.build_parameters(hosted_zone_id='1111', change_batch=batch) - self.maxDiff = None self.assertEqual(params['payload'].getvalue(), DELETE_RRSET_PAYLOAD) @@ -83,6 +83,16 @@ def test_create_healthcheck(self): 'FullyQualifiedDomainName': 'foobar.com'} params = op.build_parameters(caller_reference='foobar', health_check_config=hc_config) - self.maxDiff = None self.assertEqual(params['payload'].getvalue(), CREATE_HEALTH_CHECK_PAYLOAD) + + def test_change_tags_for_resource(self): + op = self.route53.get_operation('ChangeTagsForResource') + arguments = { + 'ResourceType': 'healthcheck', + 'ResourceId': 'foo', + 'AddTags': [{'Key': 'keyname', 'Value': 'valuename'}] + } + params = op.build_parameters(**arguments) + self.assertEqual(params['payload'].getvalue(), + CHANGE_TAGS_FOR_RESOURCE_PAYLOAD)