本文整理汇总了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"])
示例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"])
示例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"])
示例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
示例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)