当前位置: 首页>>代码示例>>Python>>正文


Python Pipeline.schedule方法代码示例

本文整理汇总了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
开发者ID:hamster-dev,项目名称:pipeline,代码行数:13,代码来源:test_pipeline.py

示例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
开发者ID:hamster-dev,项目名称:pipeline,代码行数:14,代码来源:test_pipeline.py

示例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
开发者ID:mikewaters,项目名称:pipeline,代码行数:15,代码来源:test_pipeline.py

示例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'])
开发者ID:hamster-dev,项目名称:pipeline,代码行数:16,代码来源:test_pipeline.py

示例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
开发者ID:mikewaters,项目名称:pipeline,代码行数:21,代码来源:test_pipeline.py


注:本文中的pipeline.Pipeline.schedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。