1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes #6539 Workaround py26 vs py27 difflib results

This commit is contained in:
James Tanner 2014-03-17 22:21:30 -04:00
parent 9da26da335
commit 7c5ad1fa23

View file

@ -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))