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:
parent
9da26da335
commit
7c5ad1fa23
1 changed files with 12 additions and 1 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue