'Test that two connection errors will be handled.'

@mock.patch('requests.Session.request')
def test_request_retry(self, mock_request):

    class CustomMock(object, ):
        'Define    CustomMock    object.'
        def __init__(self):
            self.i = 0
        def connection_error(self, *args, **kwargs):
            'Test    connection    error    in    CustomMock.'
            self.i += 1
            if (self.i < 3):
                raise requests.exceptions.ConnectionError
            else:
                r = requests.Response()
                r.status_code = 200
                return r
    mock_request.side_effect = CustomMock().connection_error
    cli = InfluxDBClient(database='db')
    cli.write_points(self.dummy_points)
