Skip to content
Commits on Source (2)
......@@ -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)
......
......@@ -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
......