Test shell quoting.

This commit is contained in:
Bastian Kleineidam 2010-04-04 20:28:37 +02:00
parent 8cbef81a50
commit 6e2433aa00
8 changed files with 20 additions and 20 deletions

View File

@ -69,11 +69,11 @@ class ArchiveTest (unittest.TestCase):
def archive_create (self, filename, singlefile=False, format=None, encoding=None):
"""Test archive creation."""
# the file or directory to pack
# the file or directory to pack (note that they have spaces)
if singlefile:
topack = os.path.join(datadir, 'foo.txt')
topack = os.path.join(datadir, 'foo .txt')
else:
topack = os.path.join(datadir, 'foo')
topack = os.path.join(datadir, 'foo ')
# The format and encoding arguments are needed for creating
# archives with unusual file extensions.
kwargs = dict(

View File

@ -96,21 +96,21 @@ class TestArchives (ArchiveTest):
@needs_program('bzip2')
def test_bzip2 (self):
self.program = 'bzip2'
self.archive_extract('t.bz2')
self.archive_test('t.bz2')
self.archive_create('t.bz2', singlefile=True)
self.archive_extract('t .bz2')
self.archive_test('t .bz2')
self.archive_create('t .bz2', singlefile=True)
@needs_program('pbzip2')
def test_pbzip2 (self):
self.program = 'pbzip2'
self.archive_extract('t.bz2')
self.archive_test('t.bz2')
self.archive_create('t.bz2', singlefile=True)
self.archive_extract('t .bz2')
self.archive_test('t .bz2')
self.archive_create('t .bz2', singlefile=True)
@needs_program('echo')
def test_echo (self):
self.program = 'echo'
self.archive_list('t.bz2')
self.archive_list('t .bz2')
self.archive_list('t.Z')
self.archive_list('t.lzma')
self.archive_list('t.txt.lz')
@ -154,7 +154,7 @@ class TestArchives (ArchiveTest):
self.program = '7z'
self.archive_commands('t.7z')
self.archive_list('t.gz')
self.archive_list('t.bz2')
self.archive_list('t .bz2')
self.archive_list('t.zip')
self.archive_list('t.jar')
self.archive_list('t.Z')
@ -164,7 +164,7 @@ class TestArchives (ArchiveTest):
self.archive_list('t.rpm')
self.archive_list('t.deb')
self.archive_extract('t.gz')
self.archive_extract('t.bz2')
self.archive_extract('t .bz2')
self.archive_extract('t.zip')
self.archive_extract('t.jar')
self.archive_extract('t.Z')
@ -174,7 +174,7 @@ class TestArchives (ArchiveTest):
self.archive_extract('t.rpm')
self.archive_extract('t.deb')
self.archive_test('t.gz')
self.archive_test('t.bz2')
self.archive_test('t .bz2')
self.archive_test('t.zip')
self.archive_test('t.jar')
self.archive_test('t.Z')
@ -285,9 +285,9 @@ class TestArchives (ArchiveTest):
@needs_program('xz')
def test_xz (self):
self.program = 'xz'
self.archive_test('t.xz')
self.archive_extract('t.xz')
self.archive_create('t.xz', singlefile=True)
self.archive_test('t \'".xz')
self.archive_extract('t \'".xz')
self.archive_create('t \'".xz', singlefile=True)
@needs_program('lha')
def test_lha (self):

View File

@ -49,7 +49,7 @@ class TestMime (unittest.TestCase):
self.mime_test_file("t.7z.foo", "application/x-7z-compressed", None)
self.mime_test_file("t.arj", "application/x-arj", None)
self.mime_test_file("t.arj.foo", "application/x-arj", None)
self.mime_test_file("t.bz2", "application/x-bzip2", None)
self.mime_test_file("t .bz2", "application/x-bzip2", None)
self.mime_test_file("t.bz2.foo", "application/x-bzip2", None)
self.mime_test_file("t.cab", "application/vnd.ms-cab-compressed", None)
self.mime_test_file("t.cab.foo", "application/vnd.ms-cab-compressed", None)
@ -95,7 +95,7 @@ class TestMime (unittest.TestCase):
self.mime_test_file("t.tgz.foo", "application/x-tar", "gzip")
self.mime_test_file("t.txt.gz", "application/x-gzip", None)
self.mime_test_file("t.txt.gz.foo", "application/x-gzip", None)
self.mime_test_file("t.xz", "application/x-xz", None)
self.mime_test_file("t '\".xz", "application/x-xz", None)
self.mime_test_file("t.xz.foo", "application/x-xz", None)
self.mime_test_file("t.Z", "application/x-compress", None)
self.mime_test_file("t.Z.foo", "application/x-compress", None)
@ -126,7 +126,7 @@ class TestMime (unittest.TestCase):
def test_mime_mimedb (self):
self.mime_test_mimedb("t.7z", "application/x-7z-compressed", None)
self.mime_test_mimedb("t.arj", "application/x-arj", None)
self.mime_test_mimedb("t.bz2", "application/x-bzip2", None)
self.mime_test_mimedb("t .bz2", "application/x-bzip2", None)
self.mime_test_mimedb("t.cab", "application/x-cab", None)
self.mime_test_mimedb("t.cpio", "application/x-cpio", None)
self.mime_test_mimedb("t.deb", "application/x-debian-package", None)
@ -148,7 +148,7 @@ class TestMime (unittest.TestCase):
self.mime_test_mimedb("t.tbz2", "application/x-tar", "bzip2")
self.mime_test_mimedb("t.tgz", "application/x-tar", "gzip")
self.mime_test_mimedb("t.txt.gz", "application/x-gzip", None)
self.mime_test_mimedb("t.xz", "application/x-xz", None)
self.mime_test_mimedb("t '\".xz", "application/x-xz", None)
self.mime_test_mimedb("t.Z", "application/x-compress", None)
self.mime_test_mimedb("t.zip", "application/zip", None)
self.mime_test_mimedb("t.ace", "application/x-ace", None)