本文整理汇总了Python中doit.control.TaskDispatcher._get_next_node方法的典型用法代码示例。如果您正苦于以下问题:Python TaskDispatcher._get_next_node方法的具体用法?Python TaskDispatcher._get_next_node怎么用?Python TaskDispatcher._get_next_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类doit.control.TaskDispatcher
的用法示例。
在下文中一共展示了TaskDispatcher._get_next_node方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_to_run_none
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _get_next_node [as 别名]
def test_to_run_none(self):
tasks = {'t1': Task('t1', None),
}
td = TaskDispatcher(tasks, [], None)
td._gen_node(None, 't1') # t1 was already created
to_run = ['t1']
assert None == td._get_next_node([], to_run)
assert [] == to_run
示例2: test_ready
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _get_next_node [as 别名]
def test_ready(self):
tasks = {'t1': Task('t1', None),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
n1 = td._gen_node(None, 't1')
ready = deque([n1])
assert n1 == td._get_next_node(ready, ['t2'])
assert 0 == len(ready)
示例3: test_to_run
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _get_next_node [as 别名]
def test_to_run(self):
tasks = {'t1': Task('t1', None, task_dep=['t2']),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
to_run = ['t2', 't1']
td._gen_node(None, 't1') # t1 was already created
got = td._get_next_node([], to_run)
assert isinstance(got, ExecNode)
assert 't2' == got.task.name
assert [] == to_run
示例4: test_none
# 需要导入模块: from doit.control import TaskDispatcher [as 别名]
# 或者: from doit.control.TaskDispatcher import _get_next_node [as 别名]
def test_none(self):
tasks = {'t1': Task('t1', None, task_dep=['t2']),
't2': Task('t2', None),
}
td = TaskDispatcher(tasks, [], None)
assert None == td._get_next_node([], [])