From: Steven Hardy Date: Thu, 27 Sep 2012 14:00:50 +0000 (+0100) Subject: heat tests : API test fixup for ResourceProperties X-Git-Tag: 2014.1~1346^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=642d740b86e07ec2fc60119cb62c0dabd2a28314;p=openstack-build%2Fheat-build.git heat tests : API test fixup for ResourceProperties Fixup CFN API functional test after ResourceProperties format change Change-Id: I91d88443bc885163cffafc83615aa0cfa8d3ff83 Signed-off-by: Steven Hardy --- diff --git a/heat/tests/functional/test_CFN_API_Actions.py b/heat/tests/functional/test_CFN_API_Actions.py index 7e2fa64e..76d84bd8 100644 --- a/heat/tests/functional/test_CFN_API_Actions.py +++ b/heat/tests/functional/test_CFN_API_Actions.py @@ -265,12 +265,14 @@ class CfnApiFunctionalTest(unittest.TestCase): "PhysicalResourceId") self.assertTrue(self.phys_res_id_re.match(phys_res_id) != None) - # Check ResourceProperties, the format of this is not defined - # by the AWS API spec, so we just check one expected key is there - rp_prefix = prefix + '/ResourceProperties' - prop_type = self.stack.response_xml_item(response, rp_prefix, - "InstanceType") - self.assertEqual(prop_type, "m1.xlarge") + # ResourceProperties format is defined as a string "blob" by AWS + # we return JSON encoded properies, so decode and check one key + prop_json = self.stack.response_xml_item(response, prefix, + "ResourceProperties") + self.assertTrue(prop_json != None) + + prop = json.loads(prop_json) + self.assertEqual(prop["InstanceType"], "m1.xlarge") print "DescribeStackEvents : OK"