def setup_mock_calls(mocked_call, expected_calls_and_values):
 return_values = [call[1] for call in expected_calls_and_values]
 mocked_call.side_effect = return_values

def setup_mock_calls ( mocked_call , expected_calls_and_values ) : return_values = [ call [ 1 ] for call in expected_calls_and_values ] mocked_call . side_effect = return_values
a convenient method to setup a sequence of mock calls .