'Test str_replace function parameter values.
Pass parameter values of wrong type to function and verify that we get
a TypeError.'

def test_str_replace_invalid_param_types(self):

    snippet = {'str_replace': {'template': 12345, 'params': {'var1': 'foo', 'var2': 'bar'}}}
    tmpl = template.Template(hot_tpl_empty)
    self.assertRaises(TypeError, self.resolve, snippet, tmpl)
    snippet = {'str_replace': {'template': 'Template    var1    string    var2', 'params': ['var1', 'foo', 'var2', 'bar']}}
    ex = self.assertRaises(exception.StackValidationFailed, self.resolve, snippet, tmpl)
    self.assertIn('.str_replace:    "str_replace"    parameters    must    be    a    mapping', six.text_type(ex))
