'Test str_replace function parameter keys.
Pass wrong parameters to function and verify that we get
a KeyError.'

def test_str_replace_invalid_param_keys(self):

    snippet = {'str_replace': {'tmpl': 'Template    var1    string    var2', 'params': {'var1': 'foo', 'var2': 'bar'}}}
    tmpl = template.Template(hot_tpl_empty)
    self.assertRaises(exception.StackValidationFailed, self.resolve, snippet, tmpl)
    snippet = {'str_replace': {'tmpl': 'Template    var1    string    var2', 'parms': {'var1': 'foo', 'var2': 'bar'}}}
    ex = self.assertRaises(exception.StackValidationFailed, self.resolve, snippet, tmpl)
    self.assertIn('"str_replace"    syntax    should    be    str_replace:\\n', six.text_type(ex))
