Exemplo n.º 1
0
def test_sequential_commands__abort_on_error_3(temp_folder):
    cmd_1 = AtomicCmd("true")
    cmd_2 = AtomicCmd("true")
    cmd_3 = AtomicCmd("false")
    cmds = SequentialCmds([cmd_1, cmd_2, cmd_3])
    cmds.run(temp_folder)
    assert_equal(cmds.join(), [0, 0, 1])
Exemplo n.º 2
0
def test_sequential_commands__abort_on_error_1(temp_folder):
    cmd_1 = AtomicCmd("false")
    cmd_2 = AtomicCmd(("sleep", 10))
    cmd_3 = AtomicCmd(("sleep", 10))
    cmds = SequentialCmds([cmd_1, cmd_2, cmd_3])
    cmds.run(temp_folder)
    assert_equal(cmds.join(), [1, None, None])
Exemplo n.º 3
0
def test_sequential_commands__abort_on_error_3(temp_folder):
    cmd_1 = AtomicCmd("true")
    cmd_2 = AtomicCmd("true")
    cmd_3 = AtomicCmd("false")
    cmds = SequentialCmds([cmd_1, cmd_2, cmd_3])
    cmds.run(temp_folder)
    assert_equal(cmds.join(), [0, 0, 1])
Exemplo n.º 4
0
def test_sequential_commands__abort_on_error_1(temp_folder):
    cmd_1 = AtomicCmd("false")
    cmd_2 = AtomicCmd(("sleep", 10))
    cmd_3 = AtomicCmd(("sleep", 10))
    cmds = SequentialCmds([cmd_1, cmd_2, cmd_3])
    cmds.run(temp_folder)
    assert_equal(cmds.join(), [1, None, None])
Exemplo n.º 5
0
def test_sequential_commands__atomiccmds():
    mocks = []
    for _ in range(3):
        cmd_mock = flexmock(AtomicCmd(["ls"]))
        cmd_mock.should_receive('run').with_args("xTMPx").once
        cmd_mock.should_receive('join').with_args().and_return([0]).twice
        mocks.append(cmd_mock)

    cmds = SequentialCmds(mocks)
    assert not cmds.ready()
    cmds.run("xTMPx")
    assert cmds.ready()
    assert_equal(cmds.join(), [0, 0, 0])
Exemplo n.º 6
0
def test_sequential_commands__atomiccmds():
    mocks = []
    for _ in range(3):
        cmd_mock = flexmock(AtomicCmd(["ls"]))
        cmd_mock.should_receive('run').with_args("xTMPx").once
        cmd_mock.should_receive('join').with_args().and_return([0]).twice
        mocks.append(cmd_mock)

    cmds = SequentialCmds(mocks)
    assert not cmds.ready()
    cmds.run("xTMPx")
    assert cmds.ready()
    assert_equal(cmds.join(), [0, 0, 0])