def test_reset(self): from slurmy import JobHandler, Status jh = JobHandler(work_dir=self.test_dir, verbosity=0, name='test_reset', listens=False) jh.add_job(run_script=self.run_script, name='test') jh.run_jobs() self.assertIs(jh.jobs.test.status, Status.SUCCESS) id_first = jh.jobs.test.id jh.reset() self.assertIs(jh.jobs.test.status, Status.CONFIGURED) jh.run_jobs() self.assertIs(jh.jobs.test.status, Status.SUCCESS) id_second = jh.jobs.test.id self.assertIsNot(id_first, id_second)
def test_output(self): from slurmy import JobHandler, Status jh = JobHandler(work_dir=self.test_dir, verbosity=0, name='test_output', listens=False) jh.add_job(run_script=self.run_script_touch_file, name='test', output=self.output_file) jh.run_jobs() self.assertIs(jh.jobs.test.status, Status.SUCCESS) jh.reset() jh.jobs.test.config.backend.run_script = self.run_script_success jh.jobs.test.config.output = 'jwoigjwoijegoijwoijegoiwoeg' jh.run_jobs() self.assertIs(jh.jobs.test.status, Status.FAILED)