本文整理汇总了Python中vdsm.jobs.add函数的典型用法代码示例。如果您正苦于以下问题:Python add函数的具体用法?Python add怎么用?Python add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_jobs_info_by_type_and_uuid
def test_get_jobs_info_by_type_and_uuid(self):
foo = FooJob()
jobs.add(foo)
bar = BarJob()
jobs.add(bar)
self.assertEqual({}, jobs.info(job_type=bar.job_type,
job_ids=[foo.id]))
示例2: test_get_jobs_info_any
def test_get_jobs_info_any(self):
foo = FooJob()
jobs.add(foo)
bar = BarJob()
jobs.add(bar)
self.assertEqual({foo.id: foo.info(), bar.id: bar.info()},
jobs.info())
示例3: test_get_jobs_info_by_type
def test_get_jobs_info_by_type(self):
foo = FooJob()
jobs.add(foo)
bar = BarJob()
jobs.add(bar)
self.assertEqual({bar.id: bar.info()},
jobs.info(job_type=bar.job_type))
示例4: test_get_jobs_info_by_uuid_multi
def test_get_jobs_info_by_uuid_multi(self):
foo = FooJob()
jobs.add(foo)
bar = BarJob()
jobs.add(bar)
self.assertEqual({foo.id: foo.info(), bar.id: bar.info()},
jobs.info(job_ids=[foo.id, bar.id]))
示例5: test_autodelete_disabled
def test_autodelete_disabled(self):
cfg = make_config([('jobs', 'autodelete_delay', '-1')])
job = AutodeleteJob()
jobs.add(job)
with MonkeyPatchScope([(jobs, 'config', cfg)]):
self.run_job(job)
self.assertEqual(0, len(self.scheduler.calls))
示例6: test_autodelete_when_aborted
def test_autodelete_when_aborted(self):
cfg = make_config([('jobs', 'autodelete_delay', '10')])
job = AutodeleteJob()
jobs.add(job)
with MonkeyPatchScope([(jobs, 'config', cfg)]):
job.abort()
self._verify_autodelete(job, 10)
示例7: test_autodelete_when_finished
def test_autodelete_when_finished(self, error):
cfg = make_config([('jobs', 'autodelete_delay', '10')])
job = AutodeleteJob(exception=error)
jobs.add(job)
with MonkeyPatchScope([(jobs, 'config', cfg)]):
self.run_job(job)
self._verify_autodelete(job, 10)
示例8: test_get_job
def test_get_job(self):
job = TestingJob()
jobs.add(job)
self.assertEqual(job.id, jobs.get(job.id).id)
示例9: test_add_existing_job
def test_add_existing_job(self):
job = TestingJob()
jobs.add(job)
self.assertRaises(jobs.JobExistsError, jobs.add, job)
示例10: test_add_job
def test_add_job(self):
job = TestingJob()
jobs.add(job)
self.assertEqual(1, len(jobs._jobs))
示例11: test_delete_active_job
def test_delete_active_job(self, status):
job = TestingJob()
job._status = status
jobs.add(job)
self.assertEqual(response.error(jobs.JobNotDone.name),
jobs.delete(job.id))
示例12: test_delete_inactive_job
def test_delete_inactive_job(self, status):
job = TestingJob()
job._status = status
jobs.add(job)
self.assertEqual(response.success(), jobs.delete(job.id))
示例13: test_abort_not_supported
def test_abort_not_supported(self):
job = jobs.Job(str(uuid.uuid4()))
jobs.add(job)
self.assertEqual(response.error(jobs.AbortNotSupported.name),
jobs.abort(job.id))
示例14: test_abort_job
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)
示例15: test_abort_job
def test_abort_job(self, status, aborted_status, did_abort):
job = TestingJob(status)
jobs.add(job)
jobs.abort(job.id)
self.assertEqual(aborted_status, job.status)
self.assertEqual(did_abort, job._aborted)