pype_test.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:pypyr-cli 作者: pypyr 项目源码 文件源码
def test_pype_use_parent_context_with_swallow(mock_run_pipeline):
    """pype swallowing error in child pipeline."""
    context = Context({
        'pype': {
            'name': 'pipe name',
            'pipeArg': 'argument here',
            'useParentContext': True,
            'skipParse': True,
            'raiseError': False
        }
    })

    logger = logging.getLogger('pypyr.steps.pype')
    with patch.object(logger, 'error') as mock_logger_error:
        pype.run_step(context)

    mock_run_pipeline.assert_called_once_with(
        pipeline_name='pipe name',
        pipeline_context_input='argument here',
        context=context,
        parse_input=False)

    mock_logger_error.assert_called_once_with(
        'Something went wrong pyping pipe name. RuntimeError: whoops')
    # ------------------------ run_step --------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号