summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/libtest.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/libtest.py b/test/libtest.py
index e0c2f57..452ed57 100644
--- a/test/libtest.py
+++ b/test/libtest.py
@@ -17,8 +17,7 @@ import MAT
17 17
18 18
19class TestRemovelib(test.MATTest): 19class TestRemovelib(test.MATTest):
20 ''' 20 ''' test the remove_all() method
21 test the remove_all() method
22 ''' 21 '''
23 def test_remove(self): 22 def test_remove(self):
24 '''make sure that the lib remove all compromizing meta''' 23 '''make sure that the lib remove all compromizing meta'''
@@ -38,8 +37,7 @@ class TestRemovelib(test.MATTest):
38 37
39 38
40class TestListlib(test.MATTest): 39class TestListlib(test.MATTest):
41 ''' 40 ''' test the get_meta() method
42 test the get_meta() method
43 ''' 41 '''
44 def test_list(self): 42 def test_list(self):
45 '''check if get_meta returns metadata''' 43 '''check if get_meta returns metadata'''
@@ -55,8 +53,7 @@ class TestListlib(test.MATTest):
55 53
56 54
57class TestisCleanlib(test.MATTest): 55class TestisCleanlib(test.MATTest):
58 ''' 56 ''' Test the is_clean() method
59 test the is_clean() method
60 ''' 57 '''
61 def test_dirty(self): 58 def test_dirty(self):
62 '''test is_clean on dirty files''' 59 '''test is_clean on dirty files'''
@@ -106,6 +103,8 @@ class TestArchiveProcessing(test.MATTest):
106 ''' Test archives processing 103 ''' Test archives processing
107 ''' 104 '''
108 def test_remove_bz2(self): 105 def test_remove_bz2(self):
106 ''' Test MAT's ability to process .tar.bz2
107 '''
109 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 108 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
110 tar = tarfile.open(tarpath, "w:bz2") 109 tar = tarfile.open(tarpath, "w:bz2")
111 for clean,dirty in self.file_list: 110 for clean,dirty in self.file_list:
@@ -118,6 +117,8 @@ class TestArchiveProcessing(test.MATTest):
118 self.assertTrue(current_file.is_clean()) 117 self.assertTrue(current_file.is_clean())
119 118
120 def test_remove_tar(self): 119 def test_remove_tar(self):
120 ''' Test MAT on tar files
121 '''
121 tarpath = os.path.join(self.tmpdir, "test.tar") 122 tarpath = os.path.join(self.tmpdir, "test.tar")
122 tar = tarfile.open(tarpath, "w") 123 tar = tarfile.open(tarpath, "w")
123 for clean,dirty in self.file_list: 124 for clean,dirty in self.file_list:
@@ -130,10 +131,10 @@ class TestArchiveProcessing(test.MATTest):
130 self.assertTrue(current_file.is_clean()) 131 self.assertTrue(current_file.is_clean())
131 132
132 def test_get_unsupported(self): 133 def test_get_unsupported(self):
134 ''' Test the get_unsupported feature, used by the GUI
135 '''
133 tarpath = os.path.join(self.tmpdir, "test.tar.bz2") 136 tarpath = os.path.join(self.tmpdir, "test.tar.bz2")
134 tar = tarfile.open(tarpath, "w") 137 tar = tarfile.open(tarpath, "w")
135 for clean,_ in self.file_list[:4]: # we don't test thoses
136 tar.add(clean)
137 for f in ('../mat.desktop', '../README.security', '../setup.py'): 138 for f in ('../mat.desktop', '../README.security', '../setup.py'):
138 tar.add(f, f[3:]) # trim '../' 139 tar.add(f, f[3:]) # trim '../'
139 tar.close() 140 tar.close()