class TestCondor(unittest.TestCase): def setUp(self): """ Setup a test environment """ self.job = CondorJob( 'test/test.submit', db_path='job.db', verbose=True) def tearDown(self): time.sleep( SLEEP_TIME ) for f in glob.iglob( 'test/log.*' ): os.unlink( f ) for f in glob.iglob( 'test/job.db' ): os.unlink( f ) for f in glob.iglob( 'test/results_data_out' ): os.unlink( f ) def testSubmit( self ): """ Test job submission CONDOR """ saved_stdout = sys.stdout try: out = StringIO() sys.stdout = out self.job.submit() output = out.getvalue().strip() assert output.find('Submitting job(s)') finally: sys.stdout = saved_stdout def testKill( self ): """ Test job remove CONDOR """ saved_stdout = sys.stdout try: out = StringIO() sys.stdout = out self.job.kill() output = out.getvalue().strip() assert output.find('job(s) have been marked for removal.') finally: sys.stdout = saved_stdout
class TestCondor(unittest.TestCase): def setUp(self): """ Setup a test environment """ self.job = CondorJob('test/test.submit', db_path='job.db', verbose=True) def tearDown(self): time.sleep(SLEEP_TIME) for f in glob.iglob('test/log.*'): os.unlink(f) for f in glob.iglob('test/job.db'): os.unlink(f) for f in glob.iglob('test/results_data_out'): os.unlink(f) def testSubmit(self): """ Test job submission CONDOR """ saved_stdout = sys.stdout try: out = StringIO() sys.stdout = out self.job.submit() output = out.getvalue().strip() assert output.find('Submitting job(s)') finally: sys.stdout = saved_stdout def testKill(self): """ Test job remove CONDOR """ saved_stdout = sys.stdout try: out = StringIO() sys.stdout = out self.job.kill() output = out.getvalue().strip() assert output.find('job(s) have been marked for removal.') finally: sys.stdout = saved_stdout
def setUp(self): """ Setup a test environment """ self.job = CondorJob('test/test.submit', db_path='job.db', verbose=True)
def setUp(self): """ Setup a test environment """ self.job = CondorJob( 'test/test.submit', db_path='job.db', verbose=True)