From 96e9e1b0509a9a000303ad72b2a332dc8821191e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 21 Jul 2014 14:41:24 -0400 Subject: use textwrap, simple formatting improvement. --- tests/unittests/test_templating.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/unittests/test_templating.py b/tests/unittests/test_templating.py index 5601a2e1..1ec3004b 100644 --- a/tests/unittests/test_templating.py +++ b/tests/unittests/test_templating.py @@ -17,23 +17,24 @@ # along with this program. If not, see . from tests.unittests import helpers as test_helpers +import textwrap from cloudinit import templater class TestTemplates(test_helpers.TestCase): def test_render_basic(self): - in_data = """ -${b} + in_data = textwrap.dedent(""" + ${b} -c = d -""" + c = d + """) in_data = in_data.strip() - expected_data = """ -2 + expected_data = textwrap.dedent(""" + 2 -c = d -""" + c = d + """) out_data = templater.basic_render(in_data, {'b': 2}) self.assertEqual(expected_data.strip(), out_data) @@ -102,5 +103,5 @@ $a,$b''' ex_data = "deb %s %s-updates main contrib non-free" % (mirror, codename) out_data = templater.basic_render(in_data, - {'mirror': mirror, 'codename': codename}) + {'mirror': mirror, 'codename': codename}) self.assertEqual(ex_data, out_data) -- cgit v1.2.3