'Test translation of resources including invalid keyword.'

def test_translate_resources_bad_deletion_policy(self):

    hot_tpl = template_format.parse('\n                                heat_template_version:    2013-05-23\n                                resources:\n                                        resource1:\n                                                type:    AWS::EC2::Instance\n                                                properties:\n                                                        property1:    value1\n                                                metadata:\n                                                        foo:    bar\n                                                depends_on:    dummy\n                                                DeletionPolicy:    dummy\n                                                update_policy:\n                                                        foo:    bar\n                                ')
    tmpl = template.Template(hot_tpl)
    err = self.assertRaises(exception.StackValidationFailed, tmpl.__getitem__, tmpl.RESOURCES)
    self.assertEqual('"DeletionPolicy"    is    not    a    valid    keyword    inside    a    resource    definition', six.text_type(err))
