diff options
| author | jvoisin | 2011-12-15 17:52:42 +0100 |
|---|---|---|
| committer | jvoisin | 2011-12-15 17:52:42 +0100 |
| commit | 73fc22ab0ce58ebba633d517ca436743fe62df57 (patch) | |
| tree | 8218010b7fb64111dd77e1f3be2db06a38ffbe60 /test/libtest.py | |
| parent | b9fde4ea1eb34a2f1ead1e3bfa6252fb1ca82220 (diff) | |
| parent | 13f102b65c8cf9981b2925495b95d20047b3932f (diff) | |
Merge branch 'master' of ssh://git-rw.torproject.org/user/jvoisin/mat
Diffstat (limited to 'test/libtest.py')
| -rw-r--r-- | test/libtest.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/libtest.py b/test/libtest.py index ecbc03e..bfeb548 100644 --- a/test/libtest.py +++ b/test/libtest.py | |||
| @@ -64,11 +64,25 @@ class TestisCleanlib(test.MATTest): | |||
| 64 | current_file = mat.create_class_file(clean, False, True) | 64 | current_file = mat.create_class_file(clean, False, True) |
| 65 | self.assertTrue(current_file.is_clean()) | 65 | self.assertTrue(current_file.is_clean()) |
| 66 | 66 | ||
| 67 | class TestFileAttributes(unittest.TestCase): | ||
| 68 | ''' | ||
| 69 | test various stuffs about files (readable, writable, exist, ...) | ||
| 70 | ''' | ||
| 71 | def test_not_readable(self): | ||
| 72 | self.assertFalse(mat.create_class_file('not_readable', False, True)) | ||
| 73 | |||
| 74 | def test_not_writtable(self): | ||
| 75 | self.assertFalse(mat.create_class_file('not_writtable', False, True)) | ||
| 76 | |||
| 77 | def test_not_exist(self): | ||
| 78 | self.assertFalse(mat.create_class_file('ilikecookies', False, True)) | ||
| 67 | 79 | ||
| 68 | if __name__ == '__main__': | 80 | if __name__ == '__main__': |
| 69 | Suite = unittest.TestSuite() | 81 | Suite = unittest.TestSuite() |
| 70 | Suite.addTest(unittest.makeSuite(TestRemovelib)) | 82 | Suite.addTest(unittest.makeSuite(TestRemovelib)) |
| 71 | Suite.addTest(unittest.makeSuite(TestListlib)) | 83 | Suite.addTest(unittest.makeSuite(TestListlib)) |
| 72 | Suite.addTest(unittest.makeSuite(TestisCleanlib)) | 84 | Suite.addTest(unittest.makeSuite(TestisCleanlib)) |
| 73 | unittest.TextTestRunner(verbosity=test.VERBOSITY).run(Suite) | 85 | Suite.addTest(unittest.makeSuite(TestFileAttributes)) |
| 86 | test_result = unittest.TextTestRunner(verbosity=test.VERBOSITY).run(Suite) | ||
| 87 | sys.exit(len(test_result.failures)) | ||
| 74 | 88 | ||
