mirror of
https://github.com/home-assistant/core.git
synced 2025-09-06 05:11:35 +02:00
Assert the MQTT config entry is reloaded on subentry creation and mutation (#150636)
This commit is contained in:
@@ -3367,6 +3367,7 @@ async def test_migrate_of_incompatible_config_entry(
|
||||
async def test_subentry_configflow(
|
||||
hass: HomeAssistant,
|
||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||
mock_reload_after_entry_update: MagicMock,
|
||||
config_subentries_data: dict[str, Any],
|
||||
mock_device_user_input: dict[str, Any],
|
||||
mock_entity_user_input: dict[str, Any],
|
||||
@@ -3501,6 +3502,10 @@ async def test_subentry_configflow(
|
||||
assert subentry_device_data[option] == value
|
||||
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
# Assert the entry is reloaded to set up the entity
|
||||
assert len(mock_reload_after_entry_update.mock_calls) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -3641,6 +3646,7 @@ async def test_subentry_reconfigure_remove_entity(
|
||||
async def test_subentry_reconfigure_edit_entity_multi_entitites(
|
||||
hass: HomeAssistant,
|
||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||
mock_reload_after_entry_update: MagicMock,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
user_input_mqtt: dict[str, Any],
|
||||
@@ -3758,6 +3764,10 @@ async def test_subentry_reconfigure_edit_entity_multi_entitites(
|
||||
for key, value in user_input_mqtt.items():
|
||||
assert new_components[object_list[1]][key] == value
|
||||
|
||||
# Assert the entry is reloaded to set up the entity
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
assert len(mock_reload_after_entry_update.mock_calls) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
(
|
||||
|
Reference in New Issue
Block a user