Use runtime_data for BMW (#120837)

This commit is contained in:
Richard Kroegel
2024-06-30 14:51:39 +02:00
committed by GitHub
parent d55be79e6a
commit d15d001cfc
13 changed files with 59 additions and 78 deletions
@@ -159,7 +159,7 @@ async def test_options_flow_implementation(hass: HomeAssistant) -> None:
CONF_READ_ONLY: True,
}
assert len(mock_setup_entry.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 2
async def test_reauth(hass: HomeAssistant) -> None:
@@ -210,4 +210,4 @@ async def test_reauth(hass: HomeAssistant) -> None:
assert result2["reason"] == "reauth_successful"
assert config_entry.data == FIXTURE_COMPLETE_ENTRY
assert len(mock_setup_entry.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 2
@@ -27,10 +27,7 @@ async def test_update_success(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
assert (
hass.data[config_entry.domain][config_entry.entry_id].last_update_success
is True
)
assert config_entry.runtime_data.coordinator.last_update_success is True
@pytest.mark.usefixtures("bmw_fixture")
@@ -45,7 +42,7 @@ async def test_update_failed(
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
coordinator = hass.data[config_entry.domain][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
assert coordinator.last_update_success is True
@@ -74,7 +71,7 @@ async def test_update_reauth(
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
coordinator = hass.data[config_entry.domain][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
assert coordinator.last_update_success is True