]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat tests : API test fixup for ResourceProperties
authorSteven Hardy <shardy@redhat.com>
Thu, 27 Sep 2012 14:00:50 +0000 (15:00 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 27 Sep 2012 14:00:50 +0000 (15:00 +0100)
Fixup CFN API functional test after ResourceProperties
format change

Change-Id: I91d88443bc885163cffafc83615aa0cfa8d3ff83
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/tests/functional/test_CFN_API_Actions.py

index 7e2fa64e694b9860306f44f2a94ddbe7b822f4c6..76d84bd85ec8cf62197cf1facfc1b940088d2302 100644 (file)
@@ -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"