[Git][reproducible-builds/diffoscope][master] 2 commits: tests/comparators/test_binary.py: Update tests after copy change.

Chris Lamb gitlab at salsa.debian.org
Mon May 21 12:49:06 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
e427e0ce by Chris Lamb at 2018-05-21T12:45:49+02:00
tests/comparators/test_binary.py: Update tests after copy change.

- - - - -
59b41a23 by Chris Lamb at 2018-05-21T12:48:42+02:00
Don't append rather useless "(data)" suffix.

- - - - -


2 changed files:

- diffoscope/comparators/utils/file.py
- tests/comparators/test_binary.py


Changes:

=====================================
diffoscope/comparators/utils/file.py
=====================================
--- a/diffoscope/comparators/utils/file.py
+++ b/diffoscope/comparators/utils/file.py
@@ -369,11 +369,11 @@ class File(object, metaclass=abc.ABCMeta):
                     difference = self.compare_bytes(other, source=source)
                     if difference is None:
                         return None
+                    suffix = ' ({})'.format(self.magic_file_type) \
+                        if self.magic_file_type != 'data'
                     difference.add_comment(
                         "Format-specific differences are supported for this "
-                        "file format but none were detected ({})".format(
-                            self.magic_file_type,
-                        ),
+                        "file format but none were detected{}".format(suffix))
                     )
             except subprocess.CalledProcessError as e:
                 difference = self.compare_bytes(other, source=source)


=====================================
tests/comparators/test_binary.py
=====================================
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -128,7 +128,7 @@ def test_with_compare_details_and_fallback():
             return []
     difference = MockFile(TEST_FILE1_PATH).compare(MockFile(TEST_FILE2_PATH))
     expected_diff = get_data('binary_expected_diff')
-    assert 'yet data differs' in difference.comment
+    assert 'but none were detected' in difference.comment
     assert normalize_zeros(difference.unified_diff) == expected_diff
 
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/c3426f6041dfc939eeadac53099819ba80bef399...59b41a234fd86703cfb7ffeb22328b99653e4559

---
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/c3426f6041dfc939eeadac53099819ba80bef399...59b41a234fd86703cfb7ffeb22328b99653e4559
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180521/c424a6f5/attachment.html>


More information about the rb-commits mailing list