summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvoisin2014-01-15 02:42:39 +0000
committerjvoisin2014-01-15 02:42:39 +0000
commitbbe17fd511b5890fb4554447e23d666f6c13b745 (patch)
tree5651c76da1d23ca80b252097ca1eb7880e8cf863 /test
parent5e65094084c75a9372f529a3387b072a84bf254a (diff)
Add support for zipfiles!
Diffstat (limited to 'test')
-rw-r--r--test/TODO/dirty.zipbin6433 -> 0 bytes
-rw-r--r--test/clean é.docxbin5842 -> 6520 bytes
-rw-r--r--test/clean é.odtbin33130 -> 33140 bytes
-rw-r--r--test/clean é.tar.gzbin0 -> 5656 bytes
-rw-r--r--test/clean é.zip (renamed from test/TODO/clean.zip)bin5885 -> 5885 bytes
-rw-r--r--test/dirty é.tar.gzbin0 -> 5994 bytes
-rw-r--r--test/dirty é.zipbin0 -> 6206 bytes
-rw-r--r--test/libtest.py8
8 files changed, 5 insertions, 3 deletions
diff --git a/test/TODO/dirty.zip b/test/TODO/dirty.zip
deleted file mode 100644
index a8eb59b..0000000
--- a/test/TODO/dirty.zip
+++ /dev/null
Binary files differ
diff --git a/test/clean é.docx b/test/clean é.docx
index 0f1470c..738eb6c 100644
--- a/test/clean é.docx
+++ b/test/clean é.docx
Binary files differ
diff --git a/test/clean é.odt b/test/clean é.odt
index e7a550c..a06d816 100644
--- a/test/clean é.odt
+++ b/test/clean é.odt
Binary files differ
diff --git a/test/clean é.tar.gz b/test/clean é.tar.gz
new file mode 100644
index 0000000..1ab4407
--- /dev/null
+++ b/test/clean é.tar.gz
Binary files differ
diff --git a/test/TODO/clean.zip b/test/clean é.zip
index bf46419..b2805c4 100644
--- a/test/TODO/clean.zip
+++ b/test/clean é.zip
Binary files differ
diff --git a/test/dirty é.tar.gz b/test/dirty é.tar.gz
new file mode 100644
index 0000000..8bb392b
--- /dev/null
+++ b/test/dirty é.tar.gz
Binary files differ
diff --git a/test/dirty é.zip b/test/dirty é.zip
new file mode 100644
index 0000000..e272162
--- /dev/null
+++ b/test/dirty é.zip
Binary files 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):
99 ''' 99 '''
100 self.assertRaises(MAT.exceptions.UnableToRemoveFile, MAT.mat.secure_remove, '/NOTREMOVABLE') 100 self.assertRaises(MAT.exceptions.UnableToRemoveFile, MAT.mat.secure_remove, '/NOTREMOVABLE')
101 101
102
102class TestArchiveProcessing(test.MATTest): 103class TestArchiveProcessing(test.MATTest):
103 ''' Test archives processing 104 ''' Test archives processing
104 ''' 105 '''
@@ -107,7 +108,7 @@ class TestArchiveProcessing(test.MATTest):
107 ''' 108 '''
108 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 109 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
109 tar = tarfile.open(tarpath, "w:bz2") 110 tar = tarfile.open(tarpath, "w:bz2")
110 for clean,dirty in self.file_list: 111 for clean, dirty in self.file_list:
111 tar.add(dirty) 112 tar.add(dirty)
112 tar.add(clean) 113 tar.add(clean)
113 tar.close() 114 tar.close()
@@ -121,7 +122,7 @@ class TestArchiveProcessing(test.MATTest):
121 ''' 122 '''
122 tarpath = os.path.join(self.tmpdir, "test.tar") 123 tarpath = os.path.join(self.tmpdir, "test.tar")
123 tar = tarfile.open(tarpath, "w") 124 tar = tarfile.open(tarpath, "w")
124 for clean,dirty in self.file_list: 125 for clean, dirty in self.file_list:
125 tar.add(dirty) 126 tar.add(dirty)
126 tar.add(clean) 127 tar.add(clean)
127 tar.close() 128 tar.close()
@@ -135,7 +136,7 @@ class TestArchiveProcessing(test.MATTest):
135 ''' 136 '''
136 tarpath = os.path.join(self.tmpdir, "test.tar.gz") 137 tarpath = os.path.join(self.tmpdir, "test.tar.gz")
137 tar = tarfile.open(tarpath, "w") 138 tar = tarfile.open(tarpath, "w")
138 for clean,dirty in self.file_list: 139 for clean, dirty in self.file_list:
139 tar.add(dirty) 140 tar.add(dirty)
140 tar.add(clean) 141 tar.add(clean)
141 tar.close() 142 tar.close()
@@ -156,6 +157,7 @@ class TestArchiveProcessing(test.MATTest):
156 unsupported_files = set(current_file.is_clean(list_unsupported=True)) 157 unsupported_files = set(current_file.is_clean(list_unsupported=True))
157 self.assertEqual(unsupported_files, set(('mat.desktop', 'README.security', 'setup.py'))) 158 self.assertEqual(unsupported_files, set(('mat.desktop', 'README.security', 'setup.py')))
158 159
160
159def get_tests(): 161def get_tests():
160 ''' Returns every libtests''' 162 ''' Returns every libtests'''
161 suite = unittest.TestSuite() 163 suite = unittest.TestSuite()