Skip to content
Snippets Groups Projects
Commit 52919364 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Only include xz --list --verbose output if the xz has no other differences.

parent 9a7d78f0
No related branches found
No related tags found
No related merge requests found
Pipeline #677914 failed
......@@ -80,7 +80,7 @@ class XzFile(File):
difference = super().compare(other, source)
# Append xz --list *after* showing any container differences.
if isinstance(other, XzFile):
if difference and not difference.details and isinstance(other, XzFile):
xz_list = Difference.from_operation(
XZList, self.path, other.path, source="xz --list"
)
......
......@@ -52,8 +52,6 @@ def differences(xz1, xz2):
def test_content_source(differences):
assert differences[0].source1 == "test1"
assert differences[0].source2 == "test2"
assert differences[1].source1 == "xz --list"
assert differences[1].source2 == "xz --list"
@skip_unless_tools_exist("xz")
......@@ -67,14 +65,11 @@ def test_content_source_without_extension(tmpdir, xz1, xz2):
difference = xz1.compare(xz2).details
assert difference[0].source1 == "test1-content"
assert difference[0].source2 == "test2-content"
assert difference[1].source1 == "xz --list"
assert difference[1].source2 == "xz --list"
@skip_unless_tools_exist("xz")
def test_content_diff(differences):
assert_diff(differences[0], "text_ascii_expected_diff")
assert_diff(differences[1], "text_xz_list")
@skip_unless_tools_exist("xz")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment