'Test the sending with errors.'

@patch('time.time')
def test_send_to_graphite_errors(self, mock_time):

    mock_time.return_value = 12345
    state = ha.State('domain.entity', STATE_ON, {'foo': 1.0})
    with mock.patch.object(self.gf, '_send_to_graphite') as mock_send:
        mock_send.side_effect = socket.error
        self.gf._report_attributes('entity', state)
        mock_send.side_effect = socket.gaierror
        self.gf._report_attributes('entity', state)
