Пример #1
0
 def test_existing_filter_on_unknown_var(self):
     v = "{{ hello | to_json }}"
     result = utils.template('/a/b/c', v, dict(playbook_dir='/a/b/c'))
     self.assertEqual(result, "{{ hello | to_json }}")
Пример #2
0
 def test_missing_filter(self):
     v = "{{ 'hello' | doesnotexist }}"
     result = utils.template('/a/b/c', v, dict(playbook_dir='/a/b/c'))
     self.assertEqual(result, "{{ 'hello' | doesnotexist }}")
Пример #3
0
def test_template(template, output):
    """Verify that resolvable template vars and filters get rendered."""
    result = utils.template('/base/dir', template, dict(playbook_dir='/a/b/c'))
    assert result == output
Пример #4
0
 def test_simple_template(self):
     v = "{{ playbook_dir }}"
     result = utils.template('/a/b/c', v, dict(playbook_dir='/a/b/c'))
     self.assertEqual(result, "/a/b/c")
Пример #5
0
def test_template(template, output):
    result = utils.template('/base/dir', template, dict(playbook_dir='/a/b/c'))
    assert result == output