From d38bb4152dfab69341b954f6cd0f695f7801bd07 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sun, 16 Aug 2015 10:35:09 -0400 Subject: [PATCH] fixed test to match new exception class used --- test/units/template/test_templar.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/units/template/test_templar.py b/test/units/template/test_templar.py index 6d2301fb9f9..d446efc8e35 100644 --- a/test/units/template/test_templar.py +++ b/test/units/template/test_templar.py @@ -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}}")