diff --git a/patoolib/__init__.py b/patoolib/__init__.py index aaff053..8eb8c7b 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -136,7 +136,7 @@ ArchivePrograms = { None: ('7z', '7za', 'py_zipfile'), 'extract': ('unzip',), 'list': ('unzip',), - 'test': ('unzip',), + 'test': ('zip', 'unzip',), 'create': ('zip',), }, 'gzip': { diff --git a/patoolib/programs/zip.py b/patoolib/programs/zip.py index fbbaadf..0f386a9 100644 --- a/patoolib/programs/zip.py +++ b/patoolib/programs/zip.py @@ -23,3 +23,11 @@ def create_zip (archive, compression, cmd, *args, **kwargs): cmdlist.append(archive) cmdlist.extend(args) return cmdlist + +def test_zip (archive, compression, cmd, *args, **kwargs): + """Test a ZIP archive.""" + cmdlist = [cmd, '--test'] + if kwargs['verbose']: + cmdlist.append('-v') + cmdlist.append(archive) + return cmdlist