本文整理汇总了Python中Ganga.GPIDev.Lib.Job.Job.status方法的典型用法代码示例。如果您正苦于以下问题:Python Job.status方法的具体用法?Python Job.status怎么用?Python Job.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ganga.GPIDev.Lib.Job.Job
的用法示例。
在下文中一共展示了Job.status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reset
# 需要导入模块: from Ganga.GPIDev.Lib.Job import Job [as 别名]
# 或者: from Ganga.GPIDev.Lib.Job.Job import status [as 别名]
def test_reset(db):
j = Job()
j.id = 0
j.backend = db
db._parent = j
db.getJobObject().subjobs = [Job(), Job()]
for subjob in db.getJobObject().subjobs:
subjob.backend = db
for j in db.getJobObject().subjobs:
j.status = 'completing'
disallowed_status = ['submitting', 'killed']
for status in disallowed_status:
db.getJobObject().status = status
db.reset()
assert db.getJobObject().status == status, 'status shouldn\'t have changed'
db.getJobObject().status = 'completing'
db.reset()
assert db.getJobObject().status == 'submitted', 'didn\t reset job'
assert [j.status for j in db.getJobObject().subjobs] != ['submitted', 'submitted'], 'subjobs not reset properly'
db.reset(doSubjobs=True)
assert [j.status for j in db.getJobObject().subjobs] == ['submitted', 'submitted'], 'subjobs not reset properly'
for j in db.getJobObject().subjobs:
j.status = 'completed'
db.reset(doSubjobs=True)
assert [j.status for j in db.getJobObject().subjobs] != ['submitted', 'submitted'], 'subjobs not supposed to reset'