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


Python Bladerunner.run方法代码示例

本文整理汇总了Python中bladerunner.Bladerunner.run方法的典型用法代码示例。如果您正苦于以下问题:Python Bladerunner.run方法的具体用法?Python Bladerunner.run怎么用?Python Bladerunner.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bladerunner.Bladerunner的用法示例。


在下文中一共展示了Bladerunner.run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_serial_execution

# 需要导入模块: from bladerunner import Bladerunner [as 别名]
# 或者: from bladerunner.Bladerunner import run [as 别名]
def test_serial_execution():
    """If the delay optios is set, we should call _run_serial."""

    runner = Bladerunner({"delay": 10})

    with patch.object(runner, "_run_serial") as patched_run:
        runner.run("nothing", "nowhere")

    patched_run.assert_called_once_with(["nowhere"])
开发者ID:Demonware,项目名称:bladerunner,代码行数:11,代码来源:test_base.py

示例2: test_run_no_options

# 需要导入模块: from bladerunner import Bladerunner [as 别名]
# 或者: from bladerunner.Bladerunner import run [as 别名]
def test_run_no_options():
    """Uses Mock to enforce the Bladerunner.run logic with no configuration."""

    runner = Bladerunner()

    with patch.object(runner, "_run_parallel") as patched_run:
        runner.run("nothing", "nowhere")

    patched_run.assert_called_once_with(["nowhere"])
开发者ID:Demonware,项目名称:bladerunner,代码行数:11,代码来源:test_base.py

示例3: test_progressbar_setup

# 需要导入模块: from bladerunner import Bladerunner [as 别名]
# 或者: from bladerunner.Bladerunner import run [as 别名]
def test_progressbar_setup():
    """If the progressbar is used it should be of len servers."""

    runner = Bladerunner({"progressbar": True})

    with patch.object(base, "ProgressBar") as patched_pbar:
        with patch.object(runner, "_run_parallel") as patched_run:
            runner.run("nothing", "nowhere")

    patched_pbar.assert_called_once_with(1, runner.options)
    patched_run.assert_called_once_with(["nowhere"])
开发者ID:Demonware,项目名称:bladerunner,代码行数:13,代码来源:test_base.py

示例4: test_jumpbox_errors_raise

# 需要导入模块: from bladerunner import Bladerunner [as 别名]
# 或者: from bladerunner.Bladerunner import run [as 别名]
def test_jumpbox_errors_raise():
    """Any error connecting to the jumpbox should bail the job."""

    runner = Bladerunner({
        "jump_host": "some_fake_host",
        "username": "someguy",
        "jump_pass": "hunter7",
        "jump_port": 222,
    })

    with patch.object(runner, "connect", return_value=(None, -1)) as p_connect:
        with pytest.raises(SystemExit) as p_sysexit:
            runner.run("nothing", "nowhere")

    err_msg = p_sysexit.exconly()

    p_connect.assert_called_once_with(
        "some_fake_host",
        "someguy",
        "hunter7",
        222,
    )
    assert runner.errors[0] in err_msg and "Jumpbox Error:" in err_msg
开发者ID:Demonware,项目名称:bladerunner,代码行数:25,代码来源:test_base.py

示例5: test_jumpbox_user_priority

# 需要导入模块: from bladerunner import Bladerunner [as 别名]
# 或者: from bladerunner.Bladerunner import run [as 别名]
def test_jumpbox_user_priority():
    """Ensure the jump_user is used over username for the jump host."""

    runner = Bladerunner({
        "username": "joebob",
        "jump_user": "somedude",
        "jump_host": "some_fake_host",
        "jump_pass": "hunter8",
        "jump_port": 2222,
    })

    with patch.object(runner, "connect", return_value=("ok", 0)) as p_connect:
        with patch.object(runner, "_run_serial") as p_run:
            with patch.object(runner, "close") as p_close:
                runner.run("nothing", "nowhere")

    p_connect.assert_called_once_with(
        "some_fake_host",
        "somedude",
        "hunter8",
        2222,
    )
    p_run.assert_called_once_with(["nowhere"])
    p_close.assert_called_once_with("ok", True)
开发者ID:Demonware,项目名称:bladerunner,代码行数:26,代码来源:test_base.py


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