Beispiel #1
0
 def test_expands_dict_of_templates(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates({"key": "{{ foo }}"}, params),
                      {"key": "bar"})
Beispiel #2
0
 def test_expands_simple_string_template(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates("{{ foo }}", params), "bar")
Beispiel #3
0
 def test_expands_list_of_templates(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates(["{{ foo }}"], params), ["bar"])
Beispiel #4
0
 def test_returns_same_given_string_without_template(self):
     self.assertEqual(vmdb.expand_templates("foo", {}), "foo")
Beispiel #5
0
 def test_raises_assert_if_given_incomprehensible_value(self):
     with self.assertRaises(AssertionError):
         vmdb.expand_templates(None, {})
Beispiel #6
0
 def test_expands_dict_of_templates(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates({'key': '{{ foo }}'}, params),
                      {'key': 'bar'})
Beispiel #7
0
 def test_expands_list_of_templates(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates(['{{ foo }}'], params), ['bar'])
Beispiel #8
0
 def test_expands_simple_string_template(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates('{{ foo }}', params), 'bar')