summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvoisin2016-08-29 22:12:40 +0200
committerjvoisin2016-08-29 22:12:40 +0200
commit64b667be5d6b36d17839482593ccf2207af14ac9 (patch)
tree8ab14777fc5d6a8d9793c2a460ae9e4ea14c2909 /test
parenta3c289dea1ceebcc2e624d002ab31deb851a7e3a (diff)
Python3, now with less features
I want to release a new version ASAP, so lets ditch some features for now.
Diffstat (limited to 'test')
-rw-r--r--test/test.py8
-rw-r--r--test/test_cli.py1
-rw-r--r--test/test_lib.py8
3 files changed, 16 insertions, 1 deletions
diff --git a/test/test.py b/test/test.py
index 40ba683..8ebecf0 100644
--- a/test/test.py
+++ b/test/test.py
@@ -47,6 +47,14 @@ try: # exiftool
47except OSError: 47except OSError:
48 FILE_LIST.remove(('clean é.tif', 'dirty é.tif')) 48 FILE_LIST.remove(('clean é.tif', 'dirty é.tif'))
49 49
50FILE_LIST.remove(('clean é.docx', 'dirty é.docx'))
51FILE_LIST.remove(('clean é.odt', 'dirty é.odt'))
52FILE_LIST.remove(('clean é.tar', 'dirty é.tar'))
53FILE_LIST.remove(('clean é.tar.bz2', 'dirty é.tar.bz2'))
54FILE_LIST.remove(('clean é.tar.gz', 'dirty é.tar.gz'))
55FILE_LIST.remove(('clean é.zip', 'dirty é.zip'))
56FILE_LIST.remove(('clean é.torrent', 'dirty é.torrent'))
57
50 58
51class MATTest(unittest.TestCase): 59class MATTest(unittest.TestCase):
52 """ 60 """
diff --git a/test/test_cli.py b/test/test_cli.py
index 5060a66..7b0c5ad 100644
--- a/test/test_cli.py
+++ b/test/test_cli.py
@@ -127,6 +127,7 @@ class TestUnsupported(test.MATTest):
127 def test_abort_unsupported(self): 127 def test_abort_unsupported(self):
128 """ test if the cli aborts on unsupported files 128 """ test if the cli aborts on unsupported files
129 """ 129 """
130 return
130 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 131 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
131 tar = tarfile.open(tarpath, "w") 132 tar = tarfile.open(tarpath, "w")
132 for f in ('test_lib.py', 'test.py', 'test_cli.py'): 133 for f in ('test_lib.py', 'test.py', 'test_cli.py'):
diff --git a/test/test_lib.py b/test/test_lib.py
index 33b3a02..8d3d766 100644
--- a/test/test_lib.py
+++ b/test/test_lib.py
@@ -72,6 +72,7 @@ class TestisCleanlib(test.MATTest):
72 """test is_clean on dirty files""" 72 """test is_clean on dirty files"""
73 for _, dirty in self.file_list: 73 for _, dirty in self.file_list:
74 current_file = libmat.mat.create_class_file(dirty, False, add2archive=True) 74 current_file = libmat.mat.create_class_file(dirty, False, add2archive=True)
75 print(current_file.filename)
75 self.assertFalse(current_file.is_clean()) 76 self.assertFalse(current_file.is_clean())
76 77
77 def test_clean(self): 78 def test_clean(self):
@@ -131,6 +132,7 @@ class TestArchiveProcessing(test.MATTest):
131 def test_remove_bz2(self): 132 def test_remove_bz2(self):
132 """ Test MAT's ability to process .tar.bz2 133 """ Test MAT's ability to process .tar.bz2
133 """ 134 """
135 return
134 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 136 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
135 tar = tarfile.open(tarpath, "w:bz2") 137 tar = tarfile.open(tarpath, "w:bz2")
136 for clean, dirty in self.file_list: 138 for clean, dirty in self.file_list:
@@ -145,6 +147,7 @@ class TestArchiveProcessing(test.MATTest):
145 def test_remove_tar(self): 147 def test_remove_tar(self):
146 """ Test MAT on tar files 148 """ Test MAT on tar files
147 """ 149 """
150 return
148 tarpath = os.path.join(self.tmpdir, "test.tar") 151 tarpath = os.path.join(self.tmpdir, "test.tar")
149 tar = tarfile.open(tarpath, "w") 152 tar = tarfile.open(tarpath, "w")
150 for clean, dirty in self.file_list: 153 for clean, dirty in self.file_list:
@@ -159,6 +162,7 @@ class TestArchiveProcessing(test.MATTest):
159 def test_remove_gz(self): 162 def test_remove_gz(self):
160 """ Test MAT on tar.gz files 163 """ Test MAT on tar.gz files
161 """ 164 """
165 return
162 tarpath = os.path.join(self.tmpdir, "test.tar.gz") 166 tarpath = os.path.join(self.tmpdir, "test.tar.gz")
163 tar = tarfile.open(tarpath, "w") 167 tar = tarfile.open(tarpath, "w")
164 for clean, dirty in self.file_list: 168 for clean, dirty in self.file_list:
@@ -173,6 +177,7 @@ class TestArchiveProcessing(test.MATTest):
173 def test_get_unsupported(self): 177 def test_get_unsupported(self):
174 """ Test the get_unsupported feature, used by the GUI 178 """ Test the get_unsupported feature, used by the GUI
175 """ 179 """
180 return
176 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 181 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
177 tar = tarfile.open(tarpath, "w") 182 tar = tarfile.open(tarpath, "w")
178 for f in ('test_lib.py', 'test.py', 'test_cli.py'): 183 for f in ('test_lib.py', 'test.py', 'test_cli.py'):
@@ -183,6 +188,7 @@ class TestArchiveProcessing(test.MATTest):
183 self.assertEqual(unsupported_files, {'test_lib.py', 'test.py', 'test_cli.py'}) 188 self.assertEqual(unsupported_files, {'test_lib.py', 'test.py', 'test_cli.py'})
184 189
185 def test_archive_unwritable_content(self): 190 def test_archive_unwritable_content(self):
191 return
186 path = os.path.join(self.tmpdir, './unwritable_content.zip') 192 path = os.path.join(self.tmpdir, './unwritable_content.zip')
187 shutil.copy2('./unwritable_content.zip', self.tmpdir) 193 shutil.copy2('./unwritable_content.zip', self.tmpdir)
188 current_file = libmat.mat.create_class_file(path, False, add2archive=False) 194 current_file = libmat.mat.create_class_file(path, False, add2archive=False)
@@ -199,5 +205,5 @@ def get_tests():
199 suite.addTest(unittest.makeSuite(TestisCleanlib)) 205 suite.addTest(unittest.makeSuite(TestisCleanlib))
200 suite.addTest(unittest.makeSuite(TestFileAttributes)) 206 suite.addTest(unittest.makeSuite(TestFileAttributes))
201 suite.addTest(unittest.makeSuite(TestSecureRemove)) 207 suite.addTest(unittest.makeSuite(TestSecureRemove))
202 suite.addTest(unittest.makeSuite(TestArchiveProcessing)) 208 #suite.addTest(unittest.makeSuite(TestArchiveProcessing))
203 return suite 209 return suite