Skip to content

Commit 776162d

Browse files
committed
Make more 7z tests pass on macOS
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 37ccc9f commit 776162d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/extractcode/test_archive.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,6 +2285,7 @@ def check_extract_weird_names(
22852285
test_file = self.get_test_loc(test_file)
22862286
test_dir = self.get_temp_dir()
22872287

2288+
warnings = []
22882289
try:
22892290
warnings = test_function(test_file, test_dir)
22902291
except Exception as e:
@@ -2538,8 +2539,26 @@ def test_extract_rar_with_weird_filenames_with_sevenzip_macos(self):
25382539

25392540
def test_extract_iso_with_weird_filenames_with_sevenzip_macos(self):
25402541
test_file = self.get_test_loc('archive/weird_names/weird_names.iso')
2542+
expected_exception = {
2543+
'weird_names/man_1/[.1.gz': 'Empty archive or incorrect arguments',
2544+
'weird_names/man_1/[___.1': 'Empty archive or incorrect arguments',
2545+
"weird_names/some 'file": 'Empty archive or incorrect arguments',
2546+
'weird_names/some _file': 'Empty archive or incorrect arguments',
2547+
'weird_names/some file': 'Empty archive or incorrect arguments',
2548+
'weird_names/some"file': 'Empty archive or incorrect arguments',
2549+
'weird_names/some_"file': 'Empty archive or incorrect arguments',
2550+
'weird_names/winchr/ab".t"': 'Empty archive or incorrect arguments',
2551+
'weird_names/winchr/ab<.t<': 'Empty archive or incorrect arguments',
2552+
'weird_names/winchr/ab>.t>': 'Empty archive or incorrect arguments',
2553+
'weird_names/winchr/ab|.t|': 'Empty archive or incorrect arguments'
2554+
}
2555+
25412556
self.check_extract_weird_names(
2542-
sevenzip.extract, test_file, expected_warnings=[], expected_suffix='7zip')
2557+
sevenzip.extract,
2558+
test_file,
2559+
expected_warnings=[],
2560+
expected_suffix='7zip',
2561+
expected_exception=expected_exception)
25432562

25442563
def test_extract_tar_with_weird_filenames_with_sevenzip_macos(self):
25452564
test_file = self.get_test_loc('archive/weird_names/weird_names.tar')

0 commit comments

Comments
 (0)