def test_send_error(self):
    'Test send method with error on publish.'
    self.mock_pub.side_effect = ValueError('Publish topic cannot contain wildcards.')
    with self.assertLogs(level='ERROR') as test_handle:
        self.gateway.send('1;1;1;0;1;20\n')
    self.mock_pub.assert_called_with('/1/1/1/0/1', '20', 0, True)
    self.assertEqual(test_handle.output[0].split('\n', 1)[0], 'ERROR:mysensors.gateway_mqtt:Publish to /1/1/1/0/1 failed: Publish topic cannot contain wildcards.')
Test send method with error on publish.
def test_send_error(self):
    
    self.mock_pub.side_effect = ValueError('Publish topic cannot contain wildcards.')
    with self.assertLogs(level='ERROR') as test_handle:
        self.gateway.send('1;1;1;0;1;20\n')
    self.mock_pub.assert_called_with('/1/1/1/0/1', '20', 0, True)
    self.assertEqual(test_handle.output[0].split('\n', 1)[0], 'ERROR:mysensors.gateway_mqtt:Publish to /1/1/1/0/1 failed: Publish topic cannot contain wildcards.')