Commit 97c314bc authored by Juliana Oliveira's avatar Juliana Oliveira

tests: adds skip on tests which depends on xz

Some tests ran without checking xz existence.
/skip_unless_tool_exist/ was added to tests that failed if xz is
not present.
Signed-off-by: 's avatarJuliana Oliveira <juliana.orod@gmail.com>
parent 604747e0
......@@ -22,6 +22,7 @@ import pytest
import itertools
from ..utils.data import load_fixture, get_data
from ..utils.tools import skip_unless_tools_exist
gzip1 = load_fixture('containers/a.tar.gz')
gzip2 = load_fixture('containers/b.tar.gz')
......@@ -51,6 +52,7 @@ def expected_type_diff(ext1, ext2):
return "@@ -1 +1 @@\n-%sFile\n+%sFile\n" % (ext1.capitalize(), ext2.capitalize())
# Compares same content files, but with different extensions
@skip_unless_tools_exist('xz')
def test_equal(set1):
for x, y in itertools.product(TYPES, TYPES):
diff = set1[x].compare(set1[y])
......@@ -62,6 +64,7 @@ def test_equal(set1):
assert differences[1].unified_diff == expected_type_diff(x, y)
# Compares different content files with different extensions
@skip_unless_tools_exist('xz')
def test_different(set1, set2):
for x, y in itertools.product(TYPES, TYPES):
expected_diff = get_data('containers/different_files_expected_diff')
......
......@@ -27,6 +27,7 @@ from diffoscope.comparators.binary import FilesystemFile
from diffoscope.comparators.missing_file import MissingFile
from diffoscope.comparators.utils.specialize import specialize
from ..utils.tools import skip_unless_tools_exist
from ..utils.data import load_fixture, get_data
......@@ -129,6 +130,8 @@ def test_compare_non_existing(monkeypatch, deb1):
bug881937_deb1 = load_fixture('bug881937_1.deb')
bug881937_deb2 = load_fixture('bug881937_2.deb')
@skip_unless_tools_exist('xz')
def test_compare_different_compression(bug881937_deb1, bug881937_deb2):
difference = bug881937_deb1.compare(bug881937_deb2)
assert difference.details[1].source1 == 'control.tar.gz'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment