def run_all_tests(): """ This method will run all tests, both for cli and lib. The imports of clitest and libtest are done here because of dependencie on the IS_LOCAL variable. If set to true, the tests will be done on the _local_ instance of MAT, else, on the _system-wide_ one. """ import clitest import libtest SUITE = unittest.TestSuite() SUITE.addTests(clitest.get_tests()) SUITE.addTests(libtest.get_tests()) return unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful()
def run_all_tests(): """ This method will run all tests, both for cli and lib. The imports of clitest and libtest are done here because of dependencie on the IS_LOCAL variable. If set to true, the tests will be done on the _local_ instance of MAT, else, on the _system-wide_ one. """ import clitest import libtest SUITE = unittest.TestSuite() SUITE.addTests(clitest.get_tests()) SUITE.addTests(libtest.get_tests()) return unittest.TextTestRunner( verbosity=VERBOSITY).run(SUITE).wasSuccessful()
self.file_list = [] self.tmpdir = tempfile.mkdtemp() for clean_file, dirty_file in FILE_LIST: clean_dir = os.path.join(self.tmpdir, clean_file) dirty_dir = os.path.join(self.tmpdir, dirty_file) shutil.copy2(clean_file, clean_dir) shutil.copy2(dirty_file, dirty_dir) self.file_list.append((clean_dir, dirty_dir)) def tearDown(self): """ Remove the tmp folder """ for root, dirs, files in os.walk(self.tmpdir): for d in dirs + files: os.chmod(os.path.join(root, d), 0o777) shutil.rmtree(self.tmpdir) if __name__ == '__main__': import clitest import libtest SUITE = unittest.TestSuite() SUITE.addTests(clitest.get_tests()) SUITE.addTests(libtest.get_tests()) ret = unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful() sys.exit(ret is False)
self.tmpdir = tempfile.mkdtemp() for clean_file, dirty_file in FILE_LIST: clean_dir = os.path.join(self.tmpdir, clean_file) dirty_dir = os.path.join(self.tmpdir, dirty_file) shutil.copy2(clean_file, clean_dir) shutil.copy2(dirty_file, dirty_dir) self.file_list.append((clean_dir, dirty_dir)) def tearDown(self): """ Remove the tmp folder """ for root, dirs, files in os.walk(self.tmpdir): for d in dirs + files: os.chmod(os.path.join(root, d), 0o777) shutil.rmtree(self.tmpdir) if __name__ == '__main__': import clitest import libtest SUITE = unittest.TestSuite() SUITE.addTests(clitest.get_tests()) SUITE.addTests(libtest.get_tests()) ret = unittest.TextTestRunner( verbosity=VERBOSITY).run(SUITE).wasSuccessful() sys.exit(ret is False)