mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 04:50:17 +00:00
Add type hints to integration tests (part 15) (#88006)
This commit is contained in:
@@ -123,7 +123,7 @@ ENTITY_ID2 = f"{ENTITY_ID}_2"
|
||||
},
|
||||
],
|
||||
)
|
||||
async def test_config_fan(hass, mock_modbus):
|
||||
async def test_config_fan(hass: HomeAssistant, mock_modbus) -> None:
|
||||
"""Run configuration test for fan."""
|
||||
assert FAN_DOMAIN in hass.config.components
|
||||
|
||||
@@ -188,7 +188,7 @@ async def test_config_fan(hass, mock_modbus):
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_all_fan(hass, mock_do_cycle, expected):
|
||||
async def test_all_fan(hass: HomeAssistant, mock_do_cycle, expected) -> None:
|
||||
"""Run test for given config."""
|
||||
assert hass.states.get(ENTITY_ID).state == expected
|
||||
|
||||
@@ -212,7 +212,9 @@ async def test_all_fan(hass, mock_do_cycle, expected):
|
||||
},
|
||||
],
|
||||
)
|
||||
async def test_restore_state_fan(hass, mock_test_state, mock_modbus):
|
||||
async def test_restore_state_fan(
|
||||
hass: HomeAssistant, mock_test_state, mock_modbus
|
||||
) -> None:
|
||||
"""Run test for fan restore state."""
|
||||
assert hass.states.get(ENTITY_ID).state == STATE_ON
|
||||
|
||||
@@ -239,7 +241,9 @@ async def test_restore_state_fan(hass, mock_test_state, mock_modbus):
|
||||
},
|
||||
],
|
||||
)
|
||||
async def test_fan_service_turn(hass, caplog, mock_modbus):
|
||||
async def test_fan_service_turn(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, mock_modbus
|
||||
) -> None:
|
||||
"""Run test for service turn_on/turn_off."""
|
||||
|
||||
assert MODBUS_DOMAIN in hass.config.components
|
||||
@@ -299,7 +303,7 @@ async def test_fan_service_turn(hass, caplog, mock_modbus):
|
||||
},
|
||||
],
|
||||
)
|
||||
async def test_service_fan_update(hass, mock_modbus, mock_ha):
|
||||
async def test_service_fan_update(hass: HomeAssistant, mock_modbus, mock_ha) -> None:
|
||||
"""Run test for service homeassistant.update_entity."""
|
||||
await hass.services.async_call(
|
||||
"homeassistant", "update_entity", {"entity_id": ENTITY_ID}, blocking=True
|
||||
|
||||
Reference in New Issue
Block a user