本文整理汇总了Python中pulp.bindings.responses.Task.state方法的典型用法代码示例。如果您正苦于以下问题:Python Task.state方法的具体用法?Python Task.state怎么用?Python Task.state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.bindings.responses.Task
的用法示例。
在下文中一共展示了Task.state方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: poll
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import state [as 别名]
def poll(task_id):
task = Task(TASK_TEMPLATE)
# Wait for the first 2 polls
if mock_get.call_count < 3:
task.state = STATE_WAITING
# Running for the next 10
elif mock_get.call_count < 13:
task.state = STATE_RUNNING
# Finally finish
else:
task.state = STATE_FINISHED
return Response(200, task)
示例2: test_display_status_postponed
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import state [as 别名]
def test_display_status_postponed(self):
# Setup
postponed_task = Task(TASK_TEMPLATE)
postponed_task.response = RESPONSE_POSTPONED
postponed_task.state = STATE_WAITING
# Test
status._display_status(self.context, self.renderer, [postponed_task])
# Verify
expected_tags = ['ctrl-c', 'postponed']
self.assertEqual(expected_tags, self.prompt.get_write_tags())