From: Steven Hardy Date: Tue, 16 Oct 2012 13:16:17 +0000 (+0100) Subject: heat tests : add ValidateTemplate test to CFN_API_Actions_Boto test X-Git-Tag: 2014.1~1300 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=74b207a332d67fd530f3a87fbf83f6981e75d113;p=openstack-build%2Fheat-build.git heat tests : add ValidateTemplate test to CFN_API_Actions_Boto test Add test for ValidateTemplate test to test_CFN_API_Actions_Boto.py Change-Id: I1fff55cd9aaa0c62c2a1e05050695bcd3f96664a Signed-off-by: Steven Hardy --- diff --git a/heat/tests/functional/test_CFN_API_Actions_Boto.py b/heat/tests/functional/test_CFN_API_Actions_Boto.py index afaae463..f19a80bc 100644 --- a/heat/tests/functional/test_CFN_API_Actions_Boto.py +++ b/heat/tests/functional/test_CFN_API_Actions_Boto.py @@ -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"