diff options
| author | jvoisin | 2011-06-18 04:42:52 +0200 |
|---|---|---|
| committer | jvoisin | 2011-06-18 04:42:52 +0200 |
| commit | de5917e5f01374bb1a647f49ae85283241a2bea9 (patch) | |
| tree | fbe5483af79965d1445bd4aaa528f0ad3e48a8aa /libtest.py | |
| parent | 0523e034870ed80cc3916ebb78552d661de4d3b0 (diff) | |
Creation of the arborescence
Diffstat (limited to 'libtest.py')
| -rwxr-xr-x | libtest.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/libtest.py b/libtest.py deleted file mode 100755 index 58cc618..0000000 --- a/libtest.py +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | #!/usr/bin/python | ||
| 2 | |||
| 3 | ''' | ||
| 4 | Unit test for the library | ||
| 5 | ''' | ||
| 6 | |||
| 7 | import mat | ||
| 8 | import unittest | ||
| 9 | import test | ||
| 10 | |||
| 11 | class Test_Remove_lib(test.MATTest): | ||
| 12 | def test_remove(self): | ||
| 13 | '''make sure that the lib remove all compromizing meta''' | ||
| 14 | for clean, dirty in self.file_list: | ||
| 15 | current_file = mat.create_class_file(dirty) | ||
| 16 | current_file.remove_all() | ||
| 17 | self.assertTrue(current_file.is_clean()) | ||
| 18 | |||
| 19 | def test_remove_empty(self): | ||
| 20 | '''Test removal with clean files''' | ||
| 21 | for clean, dirty in self.file_list: | ||
| 22 | current_file = mat.create_class_file(clean) | ||
| 23 | current_file.remove_all() | ||
| 24 | self.assertTrue(current_file.is_clean()) | ||
| 25 | |||
| 26 | |||
| 27 | class Test_List_lib(test.MATTest): | ||
| 28 | def test_list(self): | ||
| 29 | '''check if get_meta returns all the expected meta''' | ||
| 30 | for clean, dirty in self.file_list: | ||
| 31 | current_file = mat.create_class_file(dirty) | ||
| 32 | meta_list = dict({"fixme":"please"},) | ||
| 33 | self.assertEqual(current_file.get_meta(), meta_list) | ||
| 34 | |||
| 35 | def testlist_list_empty(self): | ||
| 36 | '''check that a listing of a clean file return an empty dict''' | ||
| 37 | for clean, dirty in self.file_list: | ||
| 38 | current_file = mat.create_class_file(clean) | ||
| 39 | self.assertEqual(current_file.get_meta(), dict()) #dirty, isn't it ? | ||
| 40 | |||
| 41 | |||
| 42 | class Test_isClean_lib(test.MATTest): | ||
| 43 | def test_dirty(self): | ||
| 44 | '''test is_clean on clean files''' | ||
| 45 | for clean, dirty in self.file_list: | ||
| 46 | current_file = mat.create_class_file(dirty) | ||
| 47 | self.assertTrue(current_file.is_clean()) | ||
| 48 | |||
| 49 | def test_clean(self): | ||
| 50 | '''test is_clean on dirty files''' | ||
| 51 | for clean, dirty in self.file_list: | ||
| 52 | current_file = mat.create_class_file(clean) | ||
| 53 | self.assertFalse(current_file.is_clean()) | ||
| 54 | |||
| 55 | |||
| 56 | if __name__ == '__main__': | ||
| 57 | suite = unittest.TestSuite() | ||
| 58 | suite.addTest(unittest.makeSuite(Test_Remove_lib)) | ||
| 59 | suite.addTest(unittest.makeSuite(Test_List_lib)) | ||
| 60 | suite.addTest(unittest.makeSuite(Test_isClean_lib)) | ||
| 61 | unittest.TextTestRunner(verbosity=2).run(suite) | ||
| 62 | |||
