[diffoscope] 03/06: Move test_listing replacements to a loop so we can easily add more.

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 14 11:31:50 CEST 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 01fb2c57f712047677efc499ca4bd23daba2b7b5
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 14 10:04:39 2016 +0100

    Move test_listing replacements to a loop so we can easily add more.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/comparators/test_squashfs.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index 970a5a1..c0adf36 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -63,9 +63,10 @@ def test_superblock(differences):
 def test_listing(differences):
     expected_diff = open(os.path.join(os.path.dirname(__file__), '../data/squashfs_listing_expected_diff.in')).read()
     # Workaround #794096
-    expected_diff = expected_diff.replace(
-        '$USER', pwd.getpwuid(1000).pw_name,
-    )
+    for x, y in (
+        ('$USER', pwd.getpwuid(1000).pw_name),
+    ):
+        expected_diff = expected_diff.replace(x, y)
     assert differences[1].unified_diff == expected_diff
 
 @pytest.mark.skipif(tool_missing('unsquashfs'), reason='missing unsquashfs')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list