'Test that three connection errors will not be handled.'

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

    class CustomMock(object, ):
        u'Create    custom    mock    object    for    test.'
        def __init__(self):
            self.i = 0
        def connection_error(self, *args, **kwargs):
            u'Handle    a    connection    error    for    the    CustomMock    object.'
            self.i += 1
            if (self.i < 4):
                raise requests.exceptions.ConnectionError
            else:
                r = requests.Response()
                r.status_code = 200
                return r
    mock_request.side_effect = CustomMock().connection_error
    cli = InfluxDBClient(database=u'db')
    with self.assertRaises(requests.exceptions.ConnectionError):
        cli.write_points(self.dummy_points)
