Skip to content

Commit 58ea556

Browse files
committed
Improve failing tests
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 8764fc3 commit 58ea556

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

scanpipe/tests/pipes/test_scancode.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ def test_scanpipe_pipes_scancode_extract_archive_errors(self):
7979
errors = scancode.extract_archive(input_location, target)
8080

8181
error_message = "gzip decompression failed"
82-
if sys.platform == "darwin":
83-
error_message += " (zlib returned error -3, msg invalid code lengths set)"
84-
85-
expected = {input_location: [error_message]}
86-
self.assertEqual(expected, errors)
82+
self.assertIn(error_message, errors[str(input_location)][0])
8783

8884
def test_scanpipe_pipes_scancode_extract_archives(self):
8985
tempdir = Path(tempfile.mkdtemp())
@@ -113,11 +109,7 @@ def test_scanpipe_pipes_scancode_extract_archives_errors(self):
113109
errors = scancode.extract_archives(tempdir)
114110

115111
error_message = "gzip decompression failed"
116-
if sys.platform == "darwin":
117-
error_message += " (zlib returned error -3, msg invalid code lengths set)"
118-
119-
expected = {str(target): [error_message]}
120-
self.assertEqual(expected, errors)
112+
self.assertIn(error_message, errors[str(target)][0])
121113

122114
@skipIf(sys.platform != "linux", "QCOW2 extraction is not available on macOS.")
123115
def test_scanpipe_pipes_scancode_extract_archive_vmimage_qcow2(self):

scanpipe/tests/test_pipelines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ class PipelinesIntegrationTest(TestCase):
535535
"file_type",
536536
# mime type and is_script are inconsistent across systems
537537
"mime_type",
538+
"type",
538539
"is_script",
539540
"notes",
540541
"settings",

0 commit comments

Comments
 (0)