def mock_perform_request(_request): raise net.ConnectionError()
def mock_perform_request(request): params = dict(request.params) if params.get(net.COUNT_KEY) != 1: raise net.ConnectionError() return request.make_fake_response(response)
def mock_perform_request(request): attempts.append(request) if len(attempts) == 1: raise net.ConnectionError() return net_utils.make_fake_response(response, request.get_full_url())
def mock_perform_request(request): attempts.append(request) if len(attempts) == 1: raise net.ConnectionError() return request.make_fake_response(response)