Fix tests.

This commit is contained in:
Bastian Kleineidam 2012-11-18 20:42:54 +01:00
parent f409b5bba6
commit e92fdd3d58
4 changed files with 12 additions and 12 deletions

View File

@ -50,6 +50,7 @@ class ArchiveTest (unittest.TestCase):
"""Run archive commands list, test, extract and create.
All keyword arguments are delegated to the create test function."""
self.archive_list(filename)
if not kwargs.get('skip_test'):
self.archive_test(filename)
if kwargs.get('singlefile'):
check_default = Content.Singlefile
@ -106,7 +107,7 @@ class ArchiveTest (unittest.TestCase):
self.assertEqual(os.path.basename(dirname), expectedname)
def check_textfile (self, filename, expectedname):
self.assertTrue(os.path.isfile(filename), filename)
self.assertTrue(os.path.isfile(filename), repr(filename))
self.assertEqual(os.path.basename(filename), expectedname)
self.assertEqual(get_filecontent(filename), TextFileContent)

View File

@ -27,4 +27,5 @@ class TestPigz (ArchiveTest):
@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', singlefile=True,
skip_create=True, skip_test=True)

View File

@ -23,9 +23,9 @@ class TestZip (ArchiveTest):
@needs_program(program)
def test_zip (self):
self.archive_create('t.zip')
self.archive_test('t.zip')
@needs_program('file')
@needs_program(program)
def test_zip_file (self):
self.archive_commands('t.zip.foo', skip_create=True)
self.archive_test('t.zip.foo')

View File

@ -22,11 +22,9 @@ class TestZoo (ArchiveTest):
@needs_program(program)
def test_zoo(self):
# XXX test failure - zoo cannot read its own files back :-(
self.archive_commands('t.zoo', singlefile=True)
# XXX test failure
#@needs_program(program)
#def test_zoo_file(self):
# self.archive_commands('t.zoo.foo', skip_create=True)
self.archive_commands('t.zoo', singlefile=True, check=None)
@needs_program('file')
@needs_program(program)
def test_zoo_file(self):
self.archive_commands('t.zoo.foo', skip_create=True, check=None, singlefile=True)