def test_subscribe_error(self):
    'Test subscribe throws error.'
    self._add_sensor(1)
    self.mock_sub.side_effect = ValueError('No topic specified, or incorrect topic type.')
    with self.assertLogs(level='ERROR') as test_handle:
        self.gateway.logic('1;1;0;0;7;Humidity Sensor\n')
    calls = [mock.call('/1/1/1/+/+', self.gateway.recv, 0), mock.call('/1/1/2/+/+', self.gateway.recv, 0)]
    self.mock_sub.assert_has_calls(calls)
    self.assertEqual(test_handle.output[0].split('\n', 1)[0], 'ERROR:mysensors.gateway_mqtt:Subscribe to /1/1/1/+/+ failed: No topic specified, or incorrect topic type.')
Test subscribe throws error.
def test_subscribe_error(self):
    
    self._add_sensor(1)
    self.mock_sub.side_effect = ValueError('No topic specified, or incorrect topic type.')
    with self.assertLogs(level='ERROR') as test_handle:
        self.gateway.logic('1;1;0;0;7;Humidity Sensor\n')
    calls = [mock.call('/1/1/1/+/+', self.gateway.recv, 0), mock.call('/1/1/2/+/+', self.gateway.recv, 0)]
    self.mock_sub.assert_has_calls(calls)
    self.assertEqual(test_handle.output[0].split('\n', 1)[0], 'ERROR:mysensors.gateway_mqtt:Subscribe to /1/1/1/+/+ failed: No topic specified, or incorrect topic type.')