Do not wait for mqtt at startup mqtt_statestream (#91721)

This commit is contained in:
Jan Bouwhuis
2023-04-21 09:00:48 +02:00
committed by GitHub
parent da26b0a930
commit 0552ec834d
2 changed files with 9 additions and 11 deletions
@@ -96,12 +96,19 @@ async def test_setup_and_stop_waits_for_ha(
mqtt_mock.async_publish.assert_not_called()
@pytest.mark.xfail()
async def test_startup_no_mqtt(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test startup without MQTT support."""
assert not await add_statestream(hass, base_topic="pub")
assert "MQTT integration is not available" in caplog.text
e_id = "fake.entity"
assert await add_statestream(hass, base_topic="pub")
# Set a state of an entity
mock_state_change_event(hass, State(e_id, "on"))
await hass.async_block_till_done()
await hass.async_block_till_done()
assert "MQTT is not enabled" in caplog.text
async def test_setup_succeeds_with_attributes(