本文整理汇总了Python中job.models.Job.increase_max_tries方法的典型用法代码示例。如果您正苦于以下问题:Python Job.increase_max_tries方法的具体用法?Python Job.increase_max_tries怎么用?Python Job.increase_max_tries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.models.Job
的用法示例。
在下文中一共展示了Job.increase_max_tries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_increase_max_tries_failed
# 需要导入模块: from job.models import Job [as 别名]
# 或者: from job.models.Job import increase_max_tries [as 别名]
def test_increase_max_tries_failed(self):
'''Tests increasing the maximum number of tries for a job instance that ran out of tries due to failures.'''
job_type = JobType(max_tries=10)
job = Job(job_type=job_type, num_exes=5, max_tries=5)
job.increase_max_tries()
self.assertEqual(job.max_tries, 15)
示例2: test_increase_max_tries_canceled
# 需要导入模块: from job.models import Job [as 别名]
# 或者: from job.models.Job import increase_max_tries [as 别名]
def test_increase_max_tries_canceled(self):
'''Tests increasing the maximum number of tries for a job instance that was canceled prematurely.'''
job_type = JobType(max_tries=10)
job = Job(job_type=job_type, num_exes=3, max_tries=5)
job.increase_max_tries()
self.assertEqual(job.max_tries, 13)