def test_parallel_commands__run(): mocks = [] for _ in range(3): cmd_mock = flexmock(AtomicCmd(["ls"])) cmd_mock.should_receive('run').with_args("xTMPx").once mocks.append(cmd_mock) cmds = ParallelCmds(mocks) cmds.run("xTMPx")
def test_parallel_commands__join_failure_3(temp_folder): mocks = _setup_mocks_for_failure(True, True, False) cmds = ParallelCmds(mocks) cmds.run(temp_folder) assert_equal(cmds.join(), ['SIGTERM', 'SIGTERM', 1])
def test_parallel_commands__join_after_run(temp_folder): cmds = ParallelCmds([AtomicCmd("true") for _ in range(3)]) cmds.run(temp_folder) assert_equal(cmds.join(), [0, 0, 0])