From a4f271f55c0739224bd32818432a59bf08b16288 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 25 Dec 2011 18:21:59 +0100 Subject: Improve modularity for testsuite The test.py file now launch all testsuites. All testsuites now have a main() function --- test/clitest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/clitest.py') diff --git a/test/clitest.py b/test/clitest.py index 4155d45..10ebff9 100644 --- a/test/clitest.py +++ b/test/clitest.py @@ -94,11 +94,15 @@ class TestFileAttributes(unittest.TestCase): stdout, _ = proc.communicate() self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'ilikecookies') -if __name__ == '__main__': + +def main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestRemovecli)) suite.addTest(unittest.makeSuite(TestListcli)) suite.addTest(unittest.makeSuite(TestisCleancli)) test_result = unittest.TextTestRunner(verbosity=test.VERBOSITY).run(suite) - sys.exit(len(test_result.failures)) + return len(test_result.failures) + +if __name__ == '__main__': + sys.exit(main()) -- cgit v1.3