From bbe17fd511b5890fb4554447e23d666f6c13b745 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 15 Jan 2014 02:42:39 +0000 Subject: Add support for zipfiles! --- test/TODO/clean.zip | Bin 5885 -> 0 bytes test/TODO/dirty.zip | Bin 6433 -> 0 bytes "test/clean \303\251.docx" | Bin 5842 -> 6520 bytes "test/clean \303\251.odt" | Bin 33130 -> 33140 bytes "test/clean \303\251.tar.gz" | Bin 0 -> 5656 bytes "test/clean \303\251.zip" | Bin 0 -> 5885 bytes "test/dirty \303\251.tar.gz" | Bin 0 -> 5994 bytes "test/dirty \303\251.zip" | Bin 0 -> 6206 bytes test/libtest.py | 8 +++++--- 9 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 test/TODO/clean.zip delete mode 100644 test/TODO/dirty.zip create mode 100644 "test/clean \303\251.tar.gz" create mode 100644 "test/clean \303\251.zip" create mode 100644 "test/dirty \303\251.tar.gz" create mode 100644 "test/dirty \303\251.zip" (limited to 'test') diff --git a/test/TODO/clean.zip b/test/TODO/clean.zip deleted file mode 100644 index bf46419..0000000 Binary files a/test/TODO/clean.zip and /dev/null differ diff --git a/test/TODO/dirty.zip b/test/TODO/dirty.zip deleted file mode 100644 index a8eb59b..0000000 Binary files a/test/TODO/dirty.zip and /dev/null differ diff --git "a/test/clean \303\251.docx" "b/test/clean \303\251.docx" index 0f1470c..738eb6c 100644 Binary files "a/test/clean \303\251.docx" and "b/test/clean \303\251.docx" differ diff --git "a/test/clean \303\251.odt" "b/test/clean \303\251.odt" index e7a550c..a06d816 100644 Binary files "a/test/clean \303\251.odt" and "b/test/clean \303\251.odt" differ diff --git "a/test/clean \303\251.tar.gz" "b/test/clean \303\251.tar.gz" new file mode 100644 index 0000000..1ab4407 Binary files /dev/null and "b/test/clean \303\251.tar.gz" differ diff --git "a/test/clean \303\251.zip" "b/test/clean \303\251.zip" new file mode 100644 index 0000000..b2805c4 Binary files /dev/null and "b/test/clean \303\251.zip" differ diff --git "a/test/dirty \303\251.tar.gz" "b/test/dirty \303\251.tar.gz" new file mode 100644 index 0000000..8bb392b Binary files /dev/null and "b/test/dirty \303\251.tar.gz" differ diff --git "a/test/dirty \303\251.zip" "b/test/dirty \303\251.zip" new file mode 100644 index 0000000..e272162 Binary files /dev/null and "b/test/dirty \303\251.zip" differ diff --git a/test/libtest.py b/test/libtest.py index 0b45505..f052b6e 100644 --- a/test/libtest.py +++ b/test/libtest.py @@ -99,6 +99,7 @@ class TestSecureRemove(unittest.TestCase): ''' self.assertRaises(MAT.exceptions.UnableToRemoveFile, MAT.mat.secure_remove, '/NOTREMOVABLE') + class TestArchiveProcessing(test.MATTest): ''' Test archives processing ''' @@ -107,7 +108,7 @@ class TestArchiveProcessing(test.MATTest): ''' tarpath = os.path.join(self.tmpdir, "test.tar.bz2") tar = tarfile.open(tarpath, "w:bz2") - for clean,dirty in self.file_list: + for clean, dirty in self.file_list: tar.add(dirty) tar.add(clean) tar.close() @@ -121,7 +122,7 @@ class TestArchiveProcessing(test.MATTest): ''' tarpath = os.path.join(self.tmpdir, "test.tar") tar = tarfile.open(tarpath, "w") - for clean,dirty in self.file_list: + for clean, dirty in self.file_list: tar.add(dirty) tar.add(clean) tar.close() @@ -135,7 +136,7 @@ class TestArchiveProcessing(test.MATTest): ''' tarpath = os.path.join(self.tmpdir, "test.tar.gz") tar = tarfile.open(tarpath, "w") - for clean,dirty in self.file_list: + for clean, dirty in self.file_list: tar.add(dirty) tar.add(clean) tar.close() @@ -156,6 +157,7 @@ class TestArchiveProcessing(test.MATTest): unsupported_files = set(current_file.is_clean(list_unsupported=True)) self.assertEqual(unsupported_files, set(('mat.desktop', 'README.security', 'setup.py'))) + def get_tests(): ''' Returns every libtests''' suite = unittest.TestSuite() -- cgit v1.3