diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-04-04 12:07:19 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-04-04 12:07:19 -0400 |
commit | 7d8a3194552387fa9e21216bcd9a3bfc76fa2b04 (patch) | |
tree | c8dc45b013208a4e5e09e6ade63b3b5994f80aa3 /tests/unittests/test_templating.py | |
parent | 93f5af9f5075a416c65c1d0350c374e16f32f0d5 (diff) | |
parent | 210b041b2fead7a57af91f60a6f89d9e5aa1ed4a (diff) | |
download | vyos-cloud-init-7d8a3194552387fa9e21216bcd9a3bfc76fa2b04.tar.gz vyos-cloud-init-7d8a3194552387fa9e21216bcd9a3bfc76fa2b04.zip |
merge with trunk
Diffstat (limited to 'tests/unittests/test_templating.py')
-rw-r--r-- | tests/unittests/test_templating.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/unittests/test_templating.py b/tests/unittests/test_templating.py index 3ba4ed8a..b9863650 100644 --- a/tests/unittests/test_templating.py +++ b/tests/unittests/test_templating.py @@ -16,11 +16,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +from __future__ import print_function + from . import helpers as test_helpers import textwrap from cloudinit import templater +try: + import Cheetah + HAS_CHEETAH = True + Cheetah # make pyflakes happy, as Cheetah is not used here +except ImportError: + HAS_CHEETAH = False + class TestTemplates(test_helpers.TestCase): def test_render_basic(self): @@ -38,6 +47,7 @@ class TestTemplates(test_helpers.TestCase): out_data = templater.basic_render(in_data, {'b': 2}) self.assertEqual(expected_data.strip(), out_data) + @test_helpers.skipIf(not HAS_CHEETAH, 'cheetah renderer not available') def test_detection(self): blob = "## template:cheetah" @@ -104,5 +114,6 @@ $a,$b''' codename) out_data = templater.basic_render(in_data, - {'mirror': mirror, 'codename': codename}) + {'mirror': mirror, + 'codename': codename}) self.assertEqual(ex_data, out_data) |