コード例 #1
0
ファイル: test_threading.py プロジェクト: a-tal/bladerunner
def test_get_run_thread(settings):
    """Confirm that the run_threaded method returns instantly."""

    runner = Bladerunner(settings)
    start_time = time.time()
    thread = runner.run_threaded(
        "echo 'hello world'",
        settings["host"],
        callback=parse_results,
    )
    assert time.time() - start_time < 2
    thread.join()
コード例 #2
0
def test_get_run_thread(settings):
    """Confirm that the run_threaded method returns instantly."""

    runner = Bladerunner(settings)
    start_time = time.time()
    thread = runner.run_threaded(
        "echo 'hello world'",
        settings["host"],
        callback=parse_results,
    )
    assert time.time() - start_time < 2
    thread.join()