'Test the event listener for write failures.'

def test_event_listener_fail_write(self, mock_client):

    self._setup()
    state = mock.MagicMock(state=1, domain='fake', entity_id='fake.entity-id', object_id='entity', attributes={})
    event = mock.MagicMock(data={'new_state': state}, time_fired=12345)
    mock_client.return_value.write_points.side_effect = influx_client.exceptions.InfluxDBClientError('foo')
    self.handler_method(event)
