コード例 #1
0
 def test_expands_dict_of_templates(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates({"key": "{{ foo }}"}, params),
                      {"key": "bar"})
コード例 #2
0
 def test_expands_simple_string_template(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates("{{ foo }}", params), "bar")
コード例 #3
0
 def test_expands_list_of_templates(self):
     params = {"foo": "bar"}
     self.assertEqual(vmdb.expand_templates(["{{ foo }}"], params), ["bar"])
コード例 #4
0
 def test_returns_same_given_string_without_template(self):
     self.assertEqual(vmdb.expand_templates("foo", {}), "foo")
コード例 #5
0
 def test_raises_assert_if_given_incomprehensible_value(self):
     with self.assertRaises(AssertionError):
         vmdb.expand_templates(None, {})
コード例 #6
0
ファイル: spec_tests.py プロジェクト: xdissent/vmdb2
 def test_expands_dict_of_templates(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates({'key': '{{ foo }}'}, params),
                      {'key': 'bar'})
コード例 #7
0
ファイル: spec_tests.py プロジェクト: xdissent/vmdb2
 def test_expands_list_of_templates(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates(['{{ foo }}'], params), ['bar'])
コード例 #8
0
ファイル: spec_tests.py プロジェクト: xdissent/vmdb2
 def test_expands_simple_string_template(self):
     params = {
         'foo': 'bar',
     }
     self.assertEqual(vmdb.expand_templates('{{ foo }}', params), 'bar')