]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat tests : add ValidateTemplate test to CFN_API_Actions_Boto test
authorSteven Hardy <shardy@redhat.com>
Tue, 16 Oct 2012 13:16:17 +0000 (14:16 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 16 Oct 2012 13:55:25 +0000 (14:55 +0100)
Add test for ValidateTemplate test to test_CFN_API_Actions_Boto.py

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

index afaae463af065df8896e28db891f6f47d7c0970e..f19a80bc4c4f43e67c8531d1899a2246279792bd 100644 (file)
@@ -351,3 +351,18 @@ class CfnApiBotoFunctionalTest(unittest.TestCase):
                         != None)
 
         print "ListStackResources : OK"
+
+    def testValidateTemplate(self):
+        client = self.stack.get_heat_client()
+        # Use stack.format_parameters to get the TemplateBody
+        params = self.stack.format_parameters()
+        val_params = {'TemplateBody': params['TemplateBody']}
+        response = client.validate_template(**val_params)
+        # Check the response contains all the expected paramter keys
+        templ_params = ['DBUsername', 'LinuxDistribution', 'InstanceType',
+                        'DBRootPassword', 'KeyName', 'DBPassword', 'DBName']
+
+        resp_params = [p.parameter_key for p in response.template_parameters]
+        for param in templ_params:
+            self.assertTrue(param in resp_params)
+        print "ValidateTemplate : OK"