summaryrefslogtreecommitdiff
path: root/test/units/template/test_templar.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/template/test_templar.py')
-rw-r--r--test/units/template/test_templar.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/test/units/template/test_templar.py b/test/units/template/test_templar.py
index 6747f768..02840e16 100644
--- a/test/units/template/test_templar.py
+++ b/test/units/template/test_templar.py
@@ -22,11 +22,10 @@ __metaclass__ = type
from jinja2.runtime import Context
from units.compat import unittest
-from unittest.mock import patch
from ansible import constants as C
from ansible.errors import AnsibleError, AnsibleUndefinedVariable
-from ansible.module_utils.six import string_types
+from ansible.plugins.loader import init_plugin_loader
from ansible.template import Templar, AnsibleContext, AnsibleEnvironment, AnsibleUndefined
from ansible.utils.unsafe_proxy import AnsibleUnsafe, wrap_var
from units.mock.loader import DictDataLoader
@@ -34,6 +33,7 @@ from units.mock.loader import DictDataLoader
class BaseTemplar(object):
def setUp(self):
+ init_plugin_loader()
self.test_vars = dict(
foo="bar",
bam="{{foo}}",
@@ -62,14 +62,6 @@ class BaseTemplar(object):
return self._ansible_context._is_unsafe(obj)
-# class used for testing arbitrary objects passed to template
-class SomeClass(object):
- foo = 'bar'
-
- def __init__(self):
- self.blip = 'blip'
-
-
class SomeUnsafeClass(AnsibleUnsafe):
def __init__(self):
super(SomeUnsafeClass, self).__init__()
@@ -266,8 +258,6 @@ class TestTemplarMisc(BaseTemplar, unittest.TestCase):
templar.available_variables = "foo=bam"
except AssertionError:
pass
- except Exception as e:
- self.fail(e)
def test_templar_escape_backslashes(self):
# Rule of thumb: If escape backslashes is True you should end up with