fixed test to match new exception class used

This commit is contained in:
Brian Coca 2015-08-16 10:35:09 -04:00
parent ee2e31b37a
commit d38bb4152d

View file

@ -19,8 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from jinja2.exceptions import UndefinedError
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, MagicMock
@ -75,8 +73,8 @@ class TestTemplar(unittest.TestCase):
#self.assertEqual(templar.template("{{lookup('file', '/path/to/my_file.txt')}}"), "foo")
# force errors
self.assertRaises(UndefinedError, templar.template, "{{bad_var}}")
self.assertRaises(UndefinedError, templar.template, "{{lookup('file', bad_var)}}")
self.assertRaises(AnsibloeUndefinedVariable, templar.template, "{{bad_var}}")
self.assertRaises(AnsibleUndefinedVariable, templar.template, "{{lookup('file', bad_var)}}")
self.assertRaises(AnsibleError, templar.template, "{{lookup('bad_lookup')}}")
self.assertRaises(AnsibleError, templar.template, "{{recursive}}")
self.assertRaises(AnsibleUndefinedVariable, templar.template, "{{foo-bar}}")