Skip to content

Commit f558ed2

Browse files
committed
Add tests for extract.py and extract_cli.py
Signed-off-by: Ravi <jravi248@gmail.com>
1 parent 9ca63d7 commit f558ed2

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
429 Bytes
Binary file not shown.
4 KB
Binary file not shown.

tests/extractcode/test_extract.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,3 +1111,18 @@ def test_extract_zipslip_tar_posix(self):
11111111

11121112
warns = [r.warnings for r in result if r.warnings]
11131113
assert [] == warns
1114+
1115+
def test_extract_ignore(self):
1116+
test_dir = self.get_test_loc('extract/ignore', copy=True)
1117+
expected = [
1118+
'a.zip',
1119+
'a.zip-extract/a.txt',
1120+
'a.zip-extract/b.zip',
1121+
'a.zip-extract/b.zip-extract/b.txt',
1122+
'a.zip-extract/c.tar',
1123+
'b.tar'
1124+
]
1125+
from extractcode import default_kinds
1126+
result = list(extract.extract(test_dir, recurse=True, ignored_extensions=('*tar',)))
1127+
check_no_error(result)
1128+
check_files(test_dir, expected)

0 commit comments

Comments
 (0)