def test_calling_result_waits(container): to_call = Mock(return_value=99) future = ParallelExecutor(container).submit(to_call, 1) assert future.result() == 99 to_call.assert_called_with(1)
def test_calling_result_waits(container): to_call = Mock(return_value=99) future = ParallelExecutor(container).submit(to_call, 1) assert future.result() == 99 to_call.assert_called_with(1)
def test_parallel_executor_submit_makes_call(container): to_call = Mock(return_value=99) future = ParallelExecutor(container).submit(to_call, 1) with wait_for_call(5, to_call) as to_call_waited: to_call_waited.assert_called_with(1) assert future.result() == 99
def test_parallel_executor_submit_makes_call(container): to_call = Mock(return_value=99) future = ParallelExecutor(container).submit(to_call, 1) with wait_for_call(5, to_call) as to_call_waited: to_call_waited.assert_called_with(1) assert future.result() == 99