1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Avoid directly changing config entry state in tests (#110048)

This commit is contained in:
J. Nick Koston
2024-02-08 16:31:17 -06:00
committed by GitHub
parent 531f2e8443
commit 02efe41564
12 changed files with 34 additions and 13 deletions

View File

@@ -179,7 +179,7 @@ async def test_service_pin_called_with_unloaded_entry(
mock_config_entry.add_to_hass(hass)
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
mock_config_entry.state = ConfigEntryState.SETUP_ERROR
mock_config_entry.mock_state(hass, ConfigEntryState.SETUP_ERROR)
hass.config.is_allowed_path = Mock(return_value=True)
mock_blink_api.cameras = {CAMERA_NAME: AsyncMock()}
@@ -207,7 +207,7 @@ async def test_service_update_called_with_unloaded_entry(
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
mock_config_entry.state = ConfigEntryState.SETUP_ERROR
mock_config_entry.mock_state(hass, ConfigEntryState.SETUP_ERROR)
hass.config.is_allowed_path = Mock(return_value=True)
mock_blink_api.cameras = {CAMERA_NAME: AsyncMock()}