def _do_test_parallel_commands__ready_two(first, second, result): cmd_mock_1 = flexmock(AtomicCmd(["ls"])) cmd_mock_1.should_receive('ready').and_return(first).at_least.once cmd_mock_2 = flexmock(AtomicCmd(["ls"])) cmd_mock_2.should_receive('ready').and_return(second) cmds = ParallelCmds([cmd_mock_1, cmd_mock_2]) assert_equal(cmds.ready(), result)
def _do_test_parallel_commands__ready_single(value): cmd_mock = flexmock(AtomicCmd(["ls"])) cmd_mock.should_receive('ready').and_return(value).at_least.once cmds = ParallelCmds([cmd_mock]) assert_equal(cmds.ready(), value)