def test_job_abort2(self): """ Test used to cancel the execution of a job by its id. A sample job is runned and then stopped. """ jm = JobManager() jm.start() job = Job(increase, (2,)) job.user = 1 jm.addJob(job) jm.abortJob(job.id, job.user) job = jm.getJob(job.id, job.user) self.assertEqual('ABORTED', job.status) jm.stop()
def test_user_abort2(self): """ Test used to stop the execution of a given job by another user. """ jm = JobManager() jm.start() job = Job(increase, (2,)) job.user = 1 jm.addJob(job) self.assertFalse(jm.abortJob(job.id, 2)) jm.stop()
def test_user_abort(self): """ Test used to stop the execution of a job by its owner. """ jm = JobManager() jm.start() job = Job(increase, (6,)) job.user = 1 jm.addJob(job) self.assertTrue(jm.abortJob(job.id, 1)) jm.stop()
def test_job_abort(self): """ Test used to cancel the execution of a job by its id. A sample job is runned and then stopped. """ jm = JobManager() jm.start() job = Job(increase, (2,)) job.user = 1 jm.addJob(job) self.assertTrue(jm.abortJob(job.id, job.user)) jm.stop()