'Test if the MQTT component fails if server fails.'

@patch('tempfile.NamedTemporaryFile', Mock(return_value=MagicMock()))
@patch('hbmqtt.broker.Broker.start', return_value=mock_coro())
def test_broker_config_fails(self, mock_run):

    from hbmqtt.broker import BrokerException
    mock_run.side_effect = BrokerException
    self.hass.config.api = MagicMock(api_password=None)
    assert (not setup_component(self.hass, mqtt.DOMAIN, {mqtt.DOMAIN: {mqtt.CONF_EMBEDDED: {}}}))
