From 7d0d0f96015c6317895e7451a77f31c2eb1196f9 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 22 Feb 2013 18:38:28 +0100 Subject: [PATCH] Use new test mode functionality. --- tests/archives/test_ar.py | 6 +++--- tests/archives/test_arc.py | 8 ++++---- tests/archives/test_bzip2.py | 4 ++-- tests/archives/test_clzip.py | 4 ++-- tests/archives/test_compress.py | 7 +++---- tests/archives/test_flac.py | 4 ++-- tests/archives/test_gzip.py | 4 ++-- tests/archives/test_lbzip2.py | 4 ++-- tests/archives/test_lzip.py | 4 ++-- tests/archives/test_lzma.py | 4 ++-- tests/archives/test_mac.py | 4 ++-- tests/archives/test_nomarch.py | 8 ++++---- tests/archives/test_pbzip2.py | 4 ++-- tests/archives/test_pdlzip.py | 4 ++-- tests/archives/test_pigz.py | 8 ++++---- tests/archives/test_plzip.py | 4 ++-- tests/archives/test_pybz2.py | 4 ++-- tests/archives/test_pygzip.py | 4 ++-- tests/archives/test_rzip.py | 6 +++--- tests/archives/test_shar.py | 6 +++--- tests/archives/test_shorten.py | 4 ++-- tests/archives/test_xz.py | 4 ++-- tests/archives/test_zoo.py | 8 ++++---- 23 files changed, 58 insertions(+), 59 deletions(-) diff --git a/tests/archives/test_ar.py b/tests/archives/test_ar.py index cdc61f5..f9da269 100644 --- a/tests/archives/test_ar.py +++ b/tests/archives/test_ar.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program, needs_os class TestAr (ArchiveTest): @@ -23,7 +23,7 @@ class TestAr (ArchiveTest): @needs_os('posix') @needs_program(program) def test_ar(self): - self.archive_commands('t.txt.a', singlefile=True) + self.archive_commands('t.txt.a', check=Content.Singlefile) @needs_os('posix') @needs_program('file') diff --git a/tests/archives/test_arc.py b/tests/archives/test_arc.py index d903216..b8782a0 100644 --- a/tests/archives/test_arc.py +++ b/tests/archives/test_arc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestArc(ArchiveTest): @@ -22,10 +22,10 @@ class TestArc(ArchiveTest): @needs_program(program) def test_arc(self): - self.archive_commands('t.arc', singlefile=True) + self.archive_commands('t.arc', check=Content.Multifile) @needs_program('file') @needs_program(program) def test_arc_file(self): - self.archive_commands('t.arc.foo', skip_create=True) + self.archive_commands('t.arc.foo', check=Content.Multifile, skip_create=True) diff --git a/tests/archives/test_bzip2.py b/tests/archives/test_bzip2.py index e1e6657..0bd2543 100644 --- a/tests/archives/test_bzip2.py +++ b/tests/archives/test_bzip2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestBzip2 (ArchiveTest): def test_bzip2 (self): self.archive_extract('t.txt.bz2', check=Content.Singlefile) self.archive_test('t.txt.bz2') - self.archive_create('t.txt.bz2', singlefile=True) + self.archive_create('t.txt.bz2', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_clzip.py b/tests/archives/test_clzip.py index a123269..161cc3d 100644 --- a/tests/archives/test_clzip.py +++ b/tests/archives/test_clzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestClzip (ArchiveTest): def test_clzip(self): self.archive_test('t.txt.lz') self.archive_extract('t.txt.lz', check=Content.Singlefile) - self.archive_create('t.txt.lz', singlefile=True) + self.archive_create('t.txt.lz', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_compress.py b/tests/archives/test_compress.py index f21e787..c175b4d 100644 --- a/tests/archives/test_compress.py +++ b/tests/archives/test_compress.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestCompress (ArchiveTest): @@ -22,5 +22,4 @@ class TestCompress (ArchiveTest): @needs_program(program) def test_compress (self): - self.archive_create('t.txt.Z', singlefile=True) - + self.archive_create('t.txt.Z', check=Content.Singlefile) diff --git a/tests/archives/test_flac.py b/tests/archives/test_flac.py index 350164d..c525c42 100644 --- a/tests/archives/test_flac.py +++ b/tests/archives/test_flac.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestFlac (ArchiveTest): def test_flac(self): self.archive_extract('t.flac', check=None) self.archive_test('t.flac') - self.archive_create('t.flac', srcfile="t.wav") + self.archive_create('t.flac', srcfiles=("t.wav",)) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_gzip.py b/tests/archives/test_gzip.py index bd55812..c452378 100644 --- a/tests/archives/test_gzip.py +++ b/tests/archives/test_gzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -22,7 +22,7 @@ class TestGzip (ArchiveTest): @needs_program(program) def test_gzip (self): - self.archive_commands('t.txt.gz', singlefile=True) + self.archive_commands('t.txt.gz', check=Content.Singlefile) self.archive_extract('t.txt.Z', check=Content.Singlefile) @needs_program('file') diff --git a/tests/archives/test_lbzip2.py b/tests/archives/test_lbzip2.py index 85bedcd..32cfe6a 100644 --- a/tests/archives/test_lbzip2.py +++ b/tests/archives/test_lbzip2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestLbzip2 (ArchiveTest): def test_lbzip2 (self): self.archive_extract('t.txt.bz2', check=Content.Singlefile) self.archive_test('t.txt.bz2') - self.archive_create('t.txt.bz2', singlefile=True) + self.archive_create('t.txt.bz2', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_lzip.py b/tests/archives/test_lzip.py index 354d849..53c0a35 100644 --- a/tests/archives/test_lzip.py +++ b/tests/archives/test_lzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestLzip (ArchiveTest): def test_lzip(self): self.archive_test('t.txt.lz') self.archive_extract('t.txt.lz', check=Content.Singlefile) - self.archive_create('t.txt.lz', singlefile=True) + self.archive_create('t.txt.lz', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_lzma.py b/tests/archives/test_lzma.py index 469e9a7..d875385 100644 --- a/tests/archives/test_lzma.py +++ b/tests/archives/test_lzma.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestLzma (ArchiveTest): def test_lzma(self): self.archive_test('t.txt.lzma') self.archive_extract('t.txt.lzma', check=Content.Singlefile) - self.archive_create('t.txt.lzma', singlefile=True) + self.archive_create('t.txt.lzma', check=Content.Singlefile) # file(1) does not recognize .lzma files #@needs_program('file') diff --git a/tests/archives/test_mac.py b/tests/archives/test_mac.py index dc25156..6a2bea1 100644 --- a/tests/archives/test_mac.py +++ b/tests/archives/test_mac.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestMac (ArchiveTest): def test_mac(self): self.archive_extract('t.ape', check=None) self.archive_test('t.ape') - self.archive_create('t.ape', srcfile="t.wav") + self.archive_create('t.ape', srcfiles=("t.wav",)) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_nomarch.py b/tests/archives/test_nomarch.py index fce1387..2892417 100644 --- a/tests/archives/test_nomarch.py +++ b/tests/archives/test_nomarch.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestNomarch(ArchiveTest): @@ -24,12 +24,12 @@ class TestNomarch(ArchiveTest): def test_nomarch(self): self.archive_test('t.arc') self.archive_list('t.arc') - self.archive_extract('t.arc') + self.archive_extract('t.arc', check=Content.Multifile) @needs_program('file') @needs_program(program) def test_nomarch_file(self): self.archive_test('t.arc.foo') self.archive_list('t.arc.foo') - self.archive_extract('t.arc.foo') + self.archive_extract('t.arc.foo', check=Content.Multifile) diff --git a/tests/archives/test_pbzip2.py b/tests/archives/test_pbzip2.py index 5ac88c2..34ae74f 100644 --- a/tests/archives/test_pbzip2.py +++ b/tests/archives/test_pbzip2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestPbzip2 (ArchiveTest): def test_pbzip2 (self): self.archive_extract('t.txt.bz2', check=Content.Singlefile) self.archive_test('t.txt.bz2') - self.archive_create('t.txt.bz2', singlefile=True) + self.archive_create('t.txt.bz2', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_pdlzip.py b/tests/archives/test_pdlzip.py index c1b96b8..bf10043 100644 --- a/tests/archives/test_pdlzip.py +++ b/tests/archives/test_pdlzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestPdlzip (ArchiveTest): def test_pdlzip(self): self.archive_test('t.txt.lz') self.archive_extract('t.txt.lz', check=Content.Singlefile) - self.archive_create('t.txt.lz', singlefile=True) + self.archive_create('t.txt.lz', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_pigz.py b/tests/archives/test_pigz.py index 67555f8..8a23c8f 100644 --- a/tests/archives/test_pigz.py +++ b/tests/archives/test_pigz.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestPigz (ArchiveTest): @@ -22,10 +22,10 @@ class TestPigz (ArchiveTest): @needs_program(program) def test_pigz (self): - self.archive_commands('t.txt.gz', singlefile=True) + self.archive_commands('t.txt.gz', check=Content.Singlefile) @needs_program('file') @needs_program(program) def test_pigz_file (self): - self.archive_commands('t.txt.gz.foo', singlefile=True, + self.archive_commands('t.txt.gz.foo', check=Content.Singlefile, skip_create=True, skip_test=True) diff --git a/tests/archives/test_plzip.py b/tests/archives/test_plzip.py index 4f98df8..50cbedf 100644 --- a/tests/archives/test_plzip.py +++ b/tests/archives/test_plzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestPlzip (ArchiveTest): def test_plzip(self): self.archive_test('t.txt.lz') self.archive_extract('t.txt.lz', check=Content.Singlefile) - self.archive_create('t.txt.lz', singlefile=True) + self.archive_create('t.txt.lz', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_pybz2.py b/tests/archives/test_pybz2.py index 2e68b18..02affff 100644 --- a/tests/archives/test_pybz2.py +++ b/tests/archives/test_pybz2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestPybz2 (ArchiveTest): def test_py_bz2 (self): self.archive_extract('t.txt.bz2', check=Content.Singlefile) # bzip2 is used to test the created archive - self.archive_create('t.txt.bz2', singlefile=True) + self.archive_create('t.txt.bz2', check=Content.Singlefile) @needs_program('file') def test_py_bz2_file (self): diff --git a/tests/archives/test_pygzip.py b/tests/archives/test_pygzip.py index 410dfdf..967660e 100644 --- a/tests/archives/test_pygzip.py +++ b/tests/archives/test_pygzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -24,7 +24,7 @@ class TestPygzip (ArchiveTest): def test_py_gzip (self): self.archive_extract('t.txt.gz', check=Content.Singlefile) # gzip is used to test the created archive - self.archive_create('t.txt.gz', singlefile=True) + self.archive_create('t.txt.gz', check=Content.Singlefile) @needs_program('file') def test_py_gzip_file (self): diff --git a/tests/archives/test_rzip.py b/tests/archives/test_rzip.py index 383d27d..4a66490 100644 --- a/tests/archives/test_rzip.py +++ b/tests/archives/test_rzip.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestRzip (ArchiveTest): @@ -23,7 +23,7 @@ class TestRzip (ArchiveTest): @needs_program(program) def test_rzip(self): self.archive_extract('t.txt.rz') - self.archive_create('t.txt.rz', singlefile=True) + self.archive_create('t.txt.rz', check=Content.Singlefile) @needs_program(program) def test_rzip_file(self): diff --git a/tests/archives/test_shar.py b/tests/archives/test_shar.py index 59dc1fa..e5b0dfa 100644 --- a/tests/archives/test_shar.py +++ b/tests/archives/test_shar.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestShar (ArchiveTest): @@ -23,5 +23,5 @@ class TestShar (ArchiveTest): @needs_program(program) @needs_program('unshar') def test_shar(self): - self.archive_create('t.shar', singlefile=True) + self.archive_create('t.shar', check=Content.Singlefile) diff --git a/tests/archives/test_shorten.py b/tests/archives/test_shorten.py index 96401ec..bb1fd9b 100644 --- a/tests/archives/test_shorten.py +++ b/tests/archives/test_shorten.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -23,7 +23,7 @@ class TestShorten (ArchiveTest): @needs_program(program) def test_shorten(self): self.archive_extract('t.shn', check=None) - self.archive_create('t.shn', srcfile="t.wav") + self.archive_create('t.shn', srcfiles=("t.wav",)) # file(1) does not recognize .shn files #@needs_program('file') diff --git a/tests/archives/test_xz.py b/tests/archives/test_xz.py index e4ebdb3..e7f5cc6 100644 --- a/tests/archives/test_xz.py +++ b/tests/archives/test_xz.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -22,7 +22,7 @@ class TestXz (ArchiveTest): @needs_program(program) def test_xz(self): - self.archive_commands('t.txt.xz', singlefile=True) + self.archive_commands('t.txt.xz', check=Content.Singlefile) @needs_program('file') @needs_program(program) diff --git a/tests/archives/test_zoo.py b/tests/archives/test_zoo.py index 00db8b1..29171a4 100644 --- a/tests/archives/test_zoo.py +++ b/tests/archives/test_zoo.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Bastian Kleineidam +# Copyright (C) 2010-2013 Bastian Kleineidam # # 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from . import ArchiveTest +from . import ArchiveTest, Content from .. import needs_program class TestZoo (ArchiveTest): @@ -22,9 +22,9 @@ class TestZoo (ArchiveTest): @needs_program(program) def test_zoo(self): - self.archive_commands('t.zoo', singlefile=True, check=None) + self.archive_commands('t.zoo', check=Content.Multifile) @needs_program('file') @needs_program(program) def test_zoo_file(self): - self.archive_commands('t.zoo.foo', skip_create=True, check=None, singlefile=True) + self.archive_commands('t.zoo.foo', skip_create=True, check=Content.Multifile)