当前位置: 首页>>代码示例>>Python>>正文


Python Job.increase_max_tries方法代码示例

本文整理汇总了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)
开发者ID:cshamis,项目名称:scale,代码行数:9,代码来源:test_models.py

示例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)
开发者ID:cshamis,项目名称:scale,代码行数:9,代码来源:test_models.py


注:本文中的job.models.Job.increase_max_tries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。