def test_abort_unknown_job(self): self.assertEqual(response.error(jobs.NoSuchJob.name), jobs.abort("foo"))
def test_abort_job(self): job = TestingJob() jobs.add(job) jobs.abort(job.id) self.assertEqual(jobs.STATUS.ABORTED, job.status) self.assertTrue(job._aborted)