From 7c5ad1fa230ff1f64aaf56442926c16ce16ccc5b Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 17 Mar 2014 22:21:30 -0400 Subject: [PATCH] Fixes #6539 Workaround py26 vs py27 difflib results --- test/units/TestUtils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/units/TestUtils.py b/test/units/TestUtils.py index a56a79e4ef2..97553271000 100644 --- a/test/units/TestUtils.py +++ b/test/units/TestUtils.py @@ -662,8 +662,19 @@ class TestUtils(unittest.TestCase): before='fooo', after='foo' ) + standard_expected = """--- before: foo +++ after: bar @@ -1 +1 @@ -fooo+foo""" - self.assertEqual(ansible.utils.get_diff(standard), standard_expected) + + # workaround py26 and py27 difflib differences + standard_expected = """-fooo+foo""" + diff = ansible.utils.get_diff(standard) + diff = diff.split('\n') + del diff[0] + del diff[0] + del diff[0] + diff = '\n'.join(diff) + self.assertEqual(diff, unicode(standard_expected)) +