def test_validate_no_parameters_in_group(self): t = template_format.parse(test_template_no_parameters) template = HOTemplate(t) stack = parser.Stack(self.ctx, 'test_stack', template) exc = self.assertRaises(exception.StackValidationFailed, stack.validate) self.assertEqual( _('Parameters must be provided for each Parameter ' 'Group.'), str(exc))
def test_validate_duplicate_parameters_in_group(self): t = template_format.parse(test_template_duplicate_parameters) template = HOTemplate(t) stack = parser.Stack( self.ctx, 'test_stack', template, environment.Environment({ 'KeyName': 'test', 'ImageId': 'sometestid', 'db_password': '******' })) exc = self.assertRaises(exception.StackValidationFailed, stack.validate) self.assertEqual( _('The InstanceType parameter must be assigned to ' 'one Parameter Group only.'), str(exc))
def test_validate_invalid_parameter_in_group(self): t = template_format.parse(test_template_invalid_parameter_name) template = HOTemplate(t) stack = parser.Stack( self.ctx, 'test_stack', template, environment.Environment({ 'KeyName': 'test', 'ImageId': 'sometestid', 'db_password': '******' })) exc = self.assertRaises(exception.StackValidationFailed, stack.validate) self.assertEqual( _('The Parameter name (SomethingNotHere) does not ' 'reference an existing parameter.'), str(exc))