本文整理汇总了Python中doit.control.TaskDispatcher._node_add_wait_run方法的典型用法代码示例。如果您正苦于以下问题:Python TaskDispatcher._node_add_wait_run方法的具体用法?Python TaskDispatcher._node_add_wait_run怎么用?Python TaskDispatcher._node_add_wait_run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类doit.control.TaskDispatcher
的用法示例。
在下文中一共展示了TaskDispatcher._node_add_wait_run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_none
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _node_add_wait_run [as 别名]
def test_none(self):
tasks = {'t1': Task('t1', None),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
n2 = td._gen_node(None, 't2')
n2.run_status = 'done'
td._node_add_wait_run(n1, ['t2'])
assert not n1.wait_run
示例2: test_deps_not_ok
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _node_add_wait_run [as 别名]
def test_deps_not_ok(self):
tasks = {'t1': Task('t1', None),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
n2 = td._gen_node(None, 't2')
n2.run_status = 'failure'
td._node_add_wait_run(n1, ['t2'])
assert n1.bad_deps
示例3: test_wait
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _node_add_wait_run [as 别名]
def test_wait(self):
tasks = {'t1': Task('t1', None),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
n2 = td._gen_node(None, 't2')
n1.wait_run.add('xxx')
td._node_add_wait_run(n1, ['t2'])
assert 2 == len(n1.wait_run)
assert 't2' in n1.wait_run
assert not n1.bad_deps
assert n1 in n2.waiting_me
示例4: test_wait_run_deps_not_ok
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _node_add_wait_run [as 别名]
def test_wait_run_deps_not_ok(self):
tasks = {'t1': Task('t1', None, task_dep=['t2']),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
n2 = td._gen_node(None, 't2')
td._node_add_wait_run(n1, ['t2'])
n2.run_status = 'failure'
td.waiting.add(n1)
td._update_waiting(n2)
assert n1.bad_deps
assert deque([n1]) == td.ready
assert 0 == len(td.waiting)
示例5: test_calc_dep_already_executed
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _node_add_wait_run [as 别名]
def test_calc_dep_already_executed(self):
tasks = {'t1': Task('t1', None, calc_dep=['t2']),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
n2 = td._gen_node(None, 't2')
n2.run_status = 'done'
n2.task.values = {'calc_dep': ['t3'], 'task_dep':['t5']}
td._node_add_wait_run(n1, ['t2'], calc=True)
# n1 is updated with results from t2
assert n1.calc_dep == set(['t2', 't3'])
assert n1.task_dep == ['t5']
# n1 doesnt need to wait any calc_dep to be executed
assert n1.wait_run_calc == set()