summaryrefslogtreecommitdiff
path: root/test/libtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/libtest.py')
-rw-r--r--test/libtest.py37
1 files changed, 23 insertions, 14 deletions
diff --git a/test/libtest.py b/test/libtest.py
index eea8117..7b7611a 100644
--- a/test/libtest.py
+++ b/test/libtest.py
@@ -10,55 +10,64 @@ import sys
10sys.path.append('..') 10sys.path.append('..')
11from lib import mat 11from lib import mat
12 12
13class Test_Remove_lib(test.MATTest): 13class TestRemovelib(test.MATTest):
14 '''
15 test the remove_all() method
16 '''
14 def test_remove(self): 17 def test_remove(self):
15 '''make sure that the lib remove all compromizing meta''' 18 '''make sure that the lib remove all compromizing meta'''
16 for clean, dirty in self.file_list: 19 for _, dirty in self.file_list:
17 current_file = mat.create_class_file(dirty, False, True) 20 current_file = mat.create_class_file(dirty, False, True)
18 current_file.remove_all() 21 current_file.remove_all()
19 self.assertTrue(current_file.is_clean()) 22 self.assertTrue(current_file.is_clean())
20 23
21 def test_remove_empty(self): 24 def test_remove_empty(self):
22 '''Test removal with clean files''' 25 '''Test removal with clean files'''
23 for clean, dirty in self.file_list: 26 for clean, _ in self.file_list:
24 current_file = mat.create_class_file(clean, False, True) 27 current_file = mat.create_class_file(clean, False, True)
25 current_file.remove_all() 28 current_file.remove_all()
26 self.assertTrue(current_file.is_clean()) 29 self.assertTrue(current_file.is_clean())
27 30
28 31
29class Test_List_lib(test.MATTest): 32class TestListlib(test.MATTest):
33 '''
34 test the get_meta() method
35 '''
30 def test_list(self): 36 def test_list(self):
31 '''check if get_meta returns all the expected meta''' 37 '''check if get_meta returns all the expected meta'''
32 for clean, dirty in self.file_list: 38 for _, dirty in self.file_list:
33 current_file = mat.create_class_file(dirty, False, True) 39 current_file = mat.create_class_file(dirty, False, True)
34 #FIXME assertisNotNone() : python 2.7 40 #FIXME assertisNotNone() : python 2.7
35 self.assertTrue(current_file.get_meta()) 41 self.assertTrue(current_file.get_meta())
36 42
37 def testlist_list_empty(self): 43 def testlist_list_empty(self):
38 '''check that a listing of a clean file return an empty dict''' 44 '''check that a listing of a clean file return an empty dict'''
39 for clean, dirty in self.file_list: 45 for clean, _ in self.file_list:
40 current_file = mat.create_class_file(clean, False, True) 46 current_file = mat.create_class_file(clean, False, True)
41 self.assertEqual(current_file.get_meta(), dict()) 47 self.assertEqual(current_file.get_meta(), dict())
42 48
43 49
44class Test_isClean_lib(test.MATTest): 50class TestisCleanlib(test.MATTest):
51 '''
52 test the is_clean() method
53 '''
45 def test_dirty(self): 54 def test_dirty(self):
46 '''test is_clean on clean files''' 55 '''test is_clean on clean files'''
47 for clean, dirty in self.file_list: 56 for _, dirty in self.file_list:
48 current_file = mat.create_class_file(dirty, False, True) 57 current_file = mat.create_class_file(dirty, False, True)
49 self.assertFalse(current_file.is_clean()) 58 self.assertFalse(current_file.is_clean())
50 59
51 def test_clean(self): 60 def test_clean(self):
52 '''test is_clean on dirty files''' 61 '''test is_clean on dirty files'''
53 for clean, dirty in self.file_list: 62 for clean, _ in self.file_list:
54 current_file = mat.create_class_file(clean, False, True) 63 current_file = mat.create_class_file(clean, False, True)
55 self.assertTrue(current_file.is_clean()) 64 self.assertTrue(current_file.is_clean())
56 65
57 66
58if __name__ == '__main__': 67if __name__ == '__main__':
59 suite = unittest.TestSuite() 68 Suite = unittest.TestSuite()
60 suite.addTest(unittest.makeSuite(Test_Remove_lib)) 69 Suite.addTest(unittest.makeSuite(TestRemovelib))
61 suite.addTest(unittest.makeSuite(Test_List_lib)) 70 Suite.addTest(unittest.makeSuite(TestListlib))
62 suite.addTest(unittest.makeSuite(Test_isClean_lib)) 71 Suite.addTest(unittest.makeSuite(TestisCleanlib))
63 unittest.TextTestRunner(verbosity=2).run(suite) 72 unittest.TextTestRunner(test.VERBOSITY).run(Suite)
64 73