Skip to content

Instantly share code, notes, and snippets.

@jctanner
Created March 18, 2014 01:26
Show Gist options
  • Save jctanner/9611869 to your computer and use it in GitHub Desktop.
Save jctanner/9611869 to your computer and use it in GitHub Desktop.
def test_get_diff(self):
standard = dict(
before_header='foo',
after_header='bar',
before='fooo',
after='foo'
)
standard_expected_py27 = """--- before: foo
+++ after: bar
@@ -1 +1 @@
-fooo+foo"""
standard_expected_py26 = """--- before: foo
+++ after: bar
@@ -1 +1 @@
-fooo+foo"""
standard_diff = ansible.utils.get_diff(standard)
if standard_diff == standard_expected_py26:
self.assertEqual(standard_diff, standard_expected_26)
elif standard_diff == standard_expected_py27:
self.assertEqual(standard_diff, standard_expected_27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment