diff --git a/tests/__init__.py b/tests/__init__.py index 8acaf3f..45c297f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -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( diff --git a/tests/data/foo.txt b/tests/data/foo .txt similarity index 100% rename from tests/data/foo.txt rename to tests/data/foo .txt diff --git a/tests/data/foo/bar/t.txt b/tests/data/foo /bar/t.txt similarity index 100% rename from tests/data/foo/bar/t.txt rename to tests/data/foo /bar/t.txt diff --git a/tests/data/foo/t.txt b/tests/data/foo /t.txt similarity index 100% rename from tests/data/foo/t.txt rename to tests/data/foo /t.txt diff --git a/tests/data/t.xz "b/tests/data/t '\".xz" similarity index 100% rename from tests/data/t.xz rename to "tests/data/t '\".xz" diff --git a/tests/data/t.bz2 b/tests/data/t .bz2 similarity index 100% rename from tests/data/t.bz2 rename to tests/data/t .bz2 diff --git a/tests/test_archives.py b/tests/test_archives.py index ea33791..11eb080 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -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): diff --git a/tests/test_mime.py b/tests/test_mime.py index 8cf554b..00c0400 100644 --- a/tests/test_mime.py +++ b/tests/test_mime.py @@ -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)