Fix mill tests (#93596)

This commit is contained in:
Erik Montnemery 2023-05-26 15:20:46 +02:00 committed by GitHub
parent b51f82719e
commit 5b654c8b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ async def test_setup_with_cloud_config(hass: HomeAssistant) -> None:
with patch(
"mill.Mill.fetch_heater_and_sensor_data", return_value={}
) as mock_fetch, patch("mill.Mill.connect", return_value=True) as mock_connect:
assert await async_setup_component(hass, "mill", entry)
assert await async_setup_component(hass, "mill", {})
assert len(mock_fetch.mock_calls) == 1
assert len(mock_connect.mock_calls) == 1
@ -40,7 +40,7 @@ async def test_setup_with_cloud_config_fails(hass: HomeAssistant) -> None:
)
entry.add_to_hass(hass)
with patch("mill.Mill.connect", return_value=False):
assert await async_setup_component(hass, "mill", entry)
assert await async_setup_component(hass, "mill", {})
assert entry.state is ConfigEntryState.SETUP_RETRY
@ -57,7 +57,7 @@ async def test_setup_with_old_cloud_config(hass: HomeAssistant) -> None:
with patch("mill.Mill.fetch_heater_and_sensor_data", return_value={}), patch(
"mill.Mill.connect", return_value=True
) as mock_connect:
assert await async_setup_component(hass, "mill", entry)
assert await async_setup_component(hass, "mill", {})
assert len(mock_connect.mock_calls) == 1
@ -90,7 +90,7 @@ async def test_setup_with_local_config(hass: HomeAssistant) -> None:
"status": "ok",
},
) as mock_connect:
assert await async_setup_component(hass, "mill", entry)
assert await async_setup_component(hass, "mill", {})
assert len(mock_fetch.mock_calls) == 1
assert len(mock_connect.mock_calls) == 1
@ -115,7 +115,7 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
), patch(
"mill.Mill.connect", return_value=True
):
assert await async_setup_component(hass, "mill", entry)
assert await async_setup_component(hass, "mill", {})
assert await hass.config_entries.async_unload(entry.entry_id)