mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Fix mill tests (#93596)
This commit is contained in:
parent
b51f82719e
commit
5b654c8b79
@ -23,7 +23,7 @@ async def test_setup_with_cloud_config(hass: HomeAssistant) -> None:
|
|||||||
with patch(
|
with patch(
|
||||||
"mill.Mill.fetch_heater_and_sensor_data", return_value={}
|
"mill.Mill.fetch_heater_and_sensor_data", return_value={}
|
||||||
) as mock_fetch, patch("mill.Mill.connect", return_value=True) as mock_connect:
|
) 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_fetch.mock_calls) == 1
|
||||||
assert len(mock_connect.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)
|
entry.add_to_hass(hass)
|
||||||
with patch("mill.Mill.connect", return_value=False):
|
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
|
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(
|
with patch("mill.Mill.fetch_heater_and_sensor_data", return_value={}), patch(
|
||||||
"mill.Mill.connect", return_value=True
|
"mill.Mill.connect", return_value=True
|
||||||
) as mock_connect:
|
) 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
|
assert len(mock_connect.mock_calls) == 1
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ async def test_setup_with_local_config(hass: HomeAssistant) -> None:
|
|||||||
"status": "ok",
|
"status": "ok",
|
||||||
},
|
},
|
||||||
) as mock_connect:
|
) 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_fetch.mock_calls) == 1
|
||||||
assert len(mock_connect.mock_calls) == 1
|
assert len(mock_connect.mock_calls) == 1
|
||||||
@ -115,7 +115,7 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
|
|||||||
), patch(
|
), patch(
|
||||||
"mill.Mill.connect", return_value=True
|
"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)
|
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user