Add type hints to integration tests (part 15) (#88006)

This commit is contained in:
epenet
2023-02-15 10:00:49 +01:00
committed by GitHub
parent 6c23d6abfe
commit 50cbabb2d8
51 changed files with 896 additions and 427 deletions

View File

@@ -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