def test_disable_validate_required_param(self):
    tmpl = template_format.parse('\n        heat_template_version: 2013-05-23\n        parameters:\n          aparam:\n            type: number\n        resources:\n          AResource:\n            type: ResourceWithPropsRefPropOnValidate\n            properties:\n              FooInt: {get_param: aparam}\n        ')
    self.stack = stack.Stack(self.ctx, 'stack_with_reqd_param', template.Template(tmpl))
    ex = self.assertRaises(exception.UserParameterMissing, self.stack.validate)
    self.assertIn('The Parameter (aparam) was not provided', str(ex))
    self.stack.strict_validate = False
    ex = self.assertRaises(exception.StackValidationFailed, self.stack.validate)
    self.assertIn('The Parameter (aparam) was not provided', str(ex))
    self.assertIsNone(self.stack.validate(validate_res_tmpl_only=True))
def test_disable_validate_required_param(self):
    tmpl = template_format.parse('\n        heat_template_version: 2013-05-23\n        parameters:\n          aparam:\n            type: number\n        resources:\n          AResource:\n            type: ResourceWithPropsRefPropOnValidate\n            properties:\n              FooInt: {get_param: aparam}\n        ')
    self.stack = stack.Stack(self.ctx, 'stack_with_reqd_param', template.Template(tmpl))
    ex = self.assertRaises(exception.UserParameterMissing, self.stack.validate)
    self.assertIn('The Parameter (aparam) was not provided', str(ex))
    self.stack.strict_validate = False
    ex = self.assertRaises(exception.StackValidationFailed, self.stack.validate)
    self.assertIn('The Parameter (aparam) was not provided', str(ex))
    self.assertIsNone(self.stack.validate(validate_res_tmpl_only=True))