def test_expands_dict_of_templates(self): params = {"foo": "bar"} self.assertEqual(vmdb.expand_templates({"key": "{{ foo }}"}, params), {"key": "bar"})
def test_expands_simple_string_template(self): params = {"foo": "bar"} self.assertEqual(vmdb.expand_templates("{{ foo }}", params), "bar")
def test_expands_list_of_templates(self): params = {"foo": "bar"} self.assertEqual(vmdb.expand_templates(["{{ foo }}"], params), ["bar"])
def test_returns_same_given_string_without_template(self): self.assertEqual(vmdb.expand_templates("foo", {}), "foo")
def test_raises_assert_if_given_incomprehensible_value(self): with self.assertRaises(AssertionError): vmdb.expand_templates(None, {})
def test_expands_dict_of_templates(self): params = { 'foo': 'bar', } self.assertEqual(vmdb.expand_templates({'key': '{{ foo }}'}, params), {'key': 'bar'})
def test_expands_list_of_templates(self): params = { 'foo': 'bar', } self.assertEqual(vmdb.expand_templates(['{{ foo }}'], params), ['bar'])
def test_expands_simple_string_template(self): params = { 'foo': 'bar', } self.assertEqual(vmdb.expand_templates('{{ foo }}', params), 'bar')