Bump ruff to 0.3.4 (#112690)

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Joost Lekkerkerker 2024-03-26 00:02:16 +01:00 committed by GitHub
parent 27219b6962
commit 6bb4e7d62c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1044 changed files with 24245 additions and 16750 deletions

View file

@ -22,9 +22,10 @@ async def test_setup_with_cloud_config(hass: HomeAssistant) -> None:
},
)
entry.add_to_hass(hass)
with patch(
"mill.Mill.fetch_heater_and_sensor_data", return_value={}
) as mock_fetch, patch("mill.Mill.connect", return_value=True) as mock_connect:
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", {})
assert len(mock_fetch.mock_calls) == 1
assert len(mock_connect.mock_calls) == 1
@ -72,9 +73,10 @@ async def test_setup_with_old_cloud_config(hass: HomeAssistant) -> None:
},
)
entry.add_to_hass(hass)
with patch("mill.Mill.fetch_heater_and_sensor_data", return_value={}), patch(
"mill.Mill.connect", return_value=True
) as mock_connect:
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", {})
assert len(mock_connect.mock_calls) == 1
@ -90,24 +92,27 @@ async def test_setup_with_local_config(hass: HomeAssistant) -> None:
},
)
entry.add_to_hass(hass)
with patch(
"mill_local.Mill.fetch_heater_and_sensor_data",
return_value={
"ambient_temperature": 20,
"set_temperature": 22,
"current_power": 0,
"control_signal": 0,
"raw_ambient_temperature": 19,
},
) as mock_fetch, patch(
"mill_local.Mill.connect",
return_value={
"name": "panel heater gen. 3",
"version": "0x210927",
"operation_key": "",
"status": "ok",
},
) as mock_connect:
with (
patch(
"mill_local.Mill.fetch_heater_and_sensor_data",
return_value={
"ambient_temperature": 20,
"set_temperature": 22,
"current_power": 0,
"control_signal": 0,
"raw_ambient_temperature": 19,
},
) as mock_fetch,
patch(
"mill_local.Mill.connect",
return_value={
"name": "panel heater gen. 3",
"version": "0x210927",
"operation_key": "",
"status": "ok",
},
) as mock_connect,
):
assert await async_setup_component(hass, "mill", {})
assert len(mock_fetch.mock_calls) == 1
@ -126,15 +131,17 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
)
entry.add_to_hass(hass)
with patch.object(
hass.config_entries,
"async_forward_entry_unload",
return_value=True,
) as unload_entry, patch(
"mill.Mill.fetch_heater_and_sensor_data", return_value={}
), patch(
"mill.Mill.connect",
return_value=True,
with (
patch.object(
hass.config_entries,
"async_forward_entry_unload",
return_value=True,
) as unload_entry,
patch("mill.Mill.fetch_heater_and_sensor_data", return_value={}),
patch(
"mill.Mill.connect",
return_value=True,
),
):
assert await async_setup_component(hass, "mill", {})