本文整理汇总了Python中pipeline.Pipeline.schedule方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.schedule方法的具体用法?Python Pipeline.schedule怎么用?Python Pipeline.schedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pipeline.Pipeline
的用法示例。
在下文中一共展示了Pipeline.schedule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unnamed_action_in_pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import schedule [as 别名]
def test_unnamed_action_in_pipeline():
"""Test that an unnamed action will get the module.task_name name."""
actions = [
TaskAction(
'stuff_increment_source',
amount='1'
),
]
executor = Pipeline(actions)
result = executor.schedule(1).get()
assert 'stuff_increment_source' in result.results
示例2: test_single_action_in_pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import schedule [as 别名]
def test_single_action_in_pipeline():
"""Test a single action scheduled by the executor.
"""
actions = [
TaskAction('stuff_increment_source',
name= 'increment',
amount='1'
)
]
executor = Pipeline(actions)
result = executor.schedule(1).get()
assert result.results['increment'] == 2
示例3: test_context_and_kwargs_application_in_pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import schedule [as 别名]
def test_context_and_kwargs_application_in_pipeline():
"""Test that both build context and user-supplied kwargs are applied
to a series of tasks in a chain.
"""
actions = [
TaskAction('increment', num='0'),
TaskAction('increment', name='increment_again', num='{{ increment }}'),
TaskAction('increment', name='increment_once_more', num='{{ increment_again }}')
]
source = None
executor = Pipeline(source, actions)
result = executor.schedule().get()
assert result.results['increment_once_more'] == 3
示例4: test_named_actions_in_pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import schedule [as 别名]
def test_named_actions_in_pipeline():
"""Test that named actions store their name in build context.
"""
dct = {
"name": "mytask",
"task": "named_action",
}
actions = [TaskAction(dct['task'], name=dct['name'])]
executor = Pipeline(actions)
ret = executor.schedule('42').get()
assert 'mytask' in ret.results.keys()
assert bool(ret.results['mytask'])
示例5: test_two_actions_in_pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import schedule [as 别名]
def test_two_actions_in_pipeline():
"""Test a single action scheduled by the executor.
"""
actions = [
TaskAction(
'stuff_increment_source',
name='increment',
amount='1'
),
TaskAction(
'stuff_increment_source',
name='increment_again',
amount='{{ increment }}'
)
]
source = 1
executor = Pipeline(source, actions)
result = executor.schedule().get()
assert result.results['increment_again'] == 3