Skip to content

Commit

Permalink
Fix failing tests #1273
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jun 26, 2024
1 parent afdc8bf commit e1186df
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions scanpipe/tests/pipes/test_scancode.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ def test_scanpipe_pipes_scancode_extract_archive_errors(self):
target = tempfile.mkdtemp()
input_location = str(self.data_location / "scancode" / "corrupted.tar.gz")
errors = scancode.extract_archive(input_location, target)
expected = {
input_location: [
"gzip decompression failed (zlib returned error -3, msg invalid code "
"lengths set)"
]
}

error_message = "gzip decompression failed"
if sys.platform == "darwin":
error_message += " (zlib returned error -3, msg invalid code lengths set)"

expected = {input_location: [error_message]}
self.assertEqual(expected, errors)

def test_scanpipe_pipes_scancode_extract_archives(self):
Expand Down Expand Up @@ -109,14 +109,13 @@ def test_scanpipe_pipes_scancode_extract_archives_errors(self):
tempdir = Path(tempfile.mkdtemp())
input_location = str(self.data_location / "scancode" / "corrupted.tar.gz")
target = copy_input(input_location, tempdir)

errors = scancode.extract_archives(tempdir)
expected = {
str(target): [
"gzip decompression failed (zlib returned error -3, msg invalid code "
"lengths set)"
]
}

error_message = "gzip decompression failed"
if sys.platform == "darwin":
error_message += " (zlib returned error -3, msg invalid code lengths set)"

expected = {str(target): [error_message]}
self.assertEqual(expected, errors)

@skipIf(sys.platform != "linux", "QCOW2 extraction is not available on macOS.")
Expand Down

0 comments on commit e1186df

Please sign in to comment.