patool/tests/archives/test_7za.py

71 lines
2.9 KiB
Python
Raw Normal View History

2012-11-14 19:24:34 +00:00
# -*- coding: utf-8 -*-
2015-07-19 15:29:33 +00:00
# Copyright (C) 2010-2015 Bastian Kleineidam
2012-11-14 19:24:34 +00:00
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import ArchiveTest, Content
from .. import needs_program
class Test7za (ArchiveTest):
program = '7za'
@needs_program(program)
def test_p7azip (self):
self.archive_commands('t .7z')
2016-01-09 19:58:15 +00:00
self.archive_commands('t .cb7')
2012-11-14 19:24:34 +00:00
self.archive_commands('t.zip')
2016-01-09 19:58:15 +00:00
self.archive_commands('t.cbz')
2012-11-14 19:24:34 +00:00
self.archive_list('t.txt.gz')
self.archive_list('t.txt.bz2')
self.archive_list('t.jar')
self.archive_list('t.txt.Z')
self.archive_list('t.cab')
self.archive_list('t.rpm')
self.archive_extract('t.txt.gz', check=Content.Singlefile)
self.archive_extract('t.txt.bz2', check=Content.Singlefile)
self.archive_extract('t.jar', check=None)
self.archive_extract('t.txt.Z', check=Content.Singlefile)
self.archive_extract('t.cab')
self.archive_test('t.txt.gz')
self.archive_test('t.txt.bz2')
self.archive_test('t.jar')
self.archive_test('t.txt.Z')
self.archive_test('t.cab')
self.archive_create('t.txt.gz', check=Content.Singlefile)
2015-07-19 15:29:33 +00:00
self.archive_create('t.txt.bz2', check=Content.Singlefile)
2012-11-14 19:24:34 +00:00
@needs_program('file')
@needs_program(program)
def test_7za_file (self):
self.archive_commands('t.7z.foo', skip_create=True)
2016-01-09 19:58:15 +00:00
self.archive_commands('t.cb7.foo', skip_create=True)
2012-11-14 19:24:34 +00:00
self.archive_commands('t.zip.foo', skip_create=True)
2016-01-09 19:58:15 +00:00
self.archive_commands('t.cbz.foo', skip_create=True)
2012-11-14 19:24:34 +00:00
self.archive_list('t.txt.gz.foo')
self.archive_list('t.txt.bz2.foo')
self.archive_list('t.jar.foo')
self.archive_list('t.txt.Z.foo')
self.archive_list('t.cab.foo')
self.archive_list('t.rpm.foo')
self.archive_extract('t.txt.gz.foo', check=None)
self.archive_extract('t.txt.bz2.foo', check=Content.Singlefile)
self.archive_extract('t.jar.foo', check=None)
self.archive_extract('t.txt.Z.foo', check=Content.Singlefile)
self.archive_extract('t.cab.foo')
self.archive_test('t.txt.gz.foo')
self.archive_test('t.txt.bz2.foo')
self.archive_test('t.jar.foo')
self.archive_test('t.txt.Z.foo')
self.archive_test('t.cab.foo')