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 }}")
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 }}")
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
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")
def test_template(template, output): result = utils.template('/base/dir', template, dict(playbook_dir='/a/b/c')) assert result == output