def test_param_validate_value(self):
    tmpl = template_format.parse("\n        HeatTemplateFormatVersion: '2012-12-12'\n        Parameters:\n          foo:\n            Type: Number\n        ")
    env1 = environment.Environment({'parameters': {'foo': 'abc'}})
    self.stack = stack.Stack(self.ctx, 'stack_with_bad_param', template.Template(tmpl, env=env1))
    ex = self.assertRaises(exception.StackValidationFailed, self.stack.validate)
    self.assertIn("Parameter 'foo' is invalid: could not convert string to float:", str(ex))
    self.assertIn('abc', str(ex))
    self.stack.strict_validate = False
    self.assertIsNone(self.stack.validate())
def test_param_validate_value(self):
    tmpl = template_format.parse("\n        HeatTemplateFormatVersion: '2012-12-12'\n        Parameters:\n          foo:\n            Type: Number\n        ")
    env1 = environment.Environment({'parameters': {'foo': 'abc'}})
    self.stack = stack.Stack(self.ctx, 'stack_with_bad_param', template.Template(tmpl, env=env1))
    ex = self.assertRaises(exception.StackValidationFailed, self.stack.validate)
    self.assertIn("Parameter 'foo' is invalid: could not convert string to float:", str(ex))
    self.assertIn('abc', str(ex))
    self.stack.strict_validate = False
    self.assertIsNone(self.stack.validate())