Add type hints to integration tests (a) (#87684)
* Add type hints to accuweather tests * Adjust a** components * Adjust aiohttp_client * ClientSessionGenerator/WebSocketGenerator
This commit is contained in:
parent
7665c89b83
commit
2545694d41
79 changed files with 720 additions and 425 deletions
|
@ -1,5 +1,6 @@
|
|||
"""The sensor tests for the august platform."""
|
||||
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, PERCENTAGE, STATE_UNKNOWN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from .mocks import (
|
||||
|
@ -11,7 +12,7 @@ from .mocks import (
|
|||
)
|
||||
|
||||
|
||||
async def test_create_doorbell(hass):
|
||||
async def test_create_doorbell(hass: HomeAssistant) -> None:
|
||||
"""Test creation of a doorbell."""
|
||||
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.json")
|
||||
await _create_august_with_devices(hass, [doorbell_one])
|
||||
|
@ -25,7 +26,7 @@ async def test_create_doorbell(hass):
|
|||
)
|
||||
|
||||
|
||||
async def test_create_doorbell_offline(hass):
|
||||
async def test_create_doorbell_offline(hass: HomeAssistant) -> None:
|
||||
"""Test creation of a doorbell that is offline."""
|
||||
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.offline.json")
|
||||
await _create_august_with_devices(hass, [doorbell_one])
|
||||
|
@ -40,7 +41,7 @@ async def test_create_doorbell_offline(hass):
|
|||
assert entry.unique_id == "tmt100_device_battery"
|
||||
|
||||
|
||||
async def test_create_doorbell_hardwired(hass):
|
||||
async def test_create_doorbell_hardwired(hass: HomeAssistant) -> None:
|
||||
"""Test creation of a doorbell that is hardwired without a battery."""
|
||||
doorbell_one = await _mock_doorbell_from_fixture(
|
||||
hass, "get_doorbell.nobattery.json"
|
||||
|
@ -51,7 +52,7 @@ async def test_create_doorbell_hardwired(hass):
|
|||
assert sensor_tmt100_name_battery is None
|
||||
|
||||
|
||||
async def test_create_lock_with_linked_keypad(hass):
|
||||
async def test_create_lock_with_linked_keypad(hass: HomeAssistant) -> None:
|
||||
"""Test creation of a lock with a linked keypad that both have a battery."""
|
||||
lock_one = await _mock_lock_from_fixture(hass, "get_lock.doorsense_init.json")
|
||||
await _create_august_with_devices(hass, [lock_one])
|
||||
|
@ -81,7 +82,7 @@ async def test_create_lock_with_linked_keypad(hass):
|
|||
assert entry.unique_id == "5bc65c24e6ef2a263e1450a8_linked_keypad_battery"
|
||||
|
||||
|
||||
async def test_create_lock_with_low_battery_linked_keypad(hass):
|
||||
async def test_create_lock_with_low_battery_linked_keypad(hass: HomeAssistant) -> None:
|
||||
"""Test creation of a lock with a linked keypad that both have a battery."""
|
||||
lock_one = await _mock_lock_from_fixture(hass, "get_lock.low_keypad_battery.json")
|
||||
await _create_august_with_devices(hass, [lock_one])
|
||||
|
@ -124,7 +125,7 @@ async def test_create_lock_with_low_battery_linked_keypad(hass):
|
|||
)
|
||||
|
||||
|
||||
async def test_lock_operator_bluetooth(hass):
|
||||
async def test_lock_operator_bluetooth(hass: HomeAssistant) -> None:
|
||||
"""Test operation of a lock with doorsense and bridge."""
|
||||
lock_one = await _mock_doorsense_enabled_august_lock_detail(hass)
|
||||
|
||||
|
@ -168,7 +169,7 @@ async def test_lock_operator_bluetooth(hass):
|
|||
)
|
||||
|
||||
|
||||
async def test_lock_operator_keypad(hass):
|
||||
async def test_lock_operator_keypad(hass: HomeAssistant) -> None:
|
||||
"""Test operation of a lock with doorsense and bridge."""
|
||||
lock_one = await _mock_doorsense_enabled_august_lock_detail(hass)
|
||||
|
||||
|
@ -212,7 +213,7 @@ async def test_lock_operator_keypad(hass):
|
|||
)
|
||||
|
||||
|
||||
async def test_lock_operator_remote(hass):
|
||||
async def test_lock_operator_remote(hass: HomeAssistant) -> None:
|
||||
"""Test operation of a lock with doorsense and bridge."""
|
||||
lock_one = await _mock_doorsense_enabled_august_lock_detail(hass)
|
||||
|
||||
|
@ -254,7 +255,7 @@ async def test_lock_operator_remote(hass):
|
|||
)
|
||||
|
||||
|
||||
async def test_lock_operator_autorelock(hass):
|
||||
async def test_lock_operator_autorelock(hass: HomeAssistant) -> None:
|
||||
"""Test operation of a lock with doorsense and bridge."""
|
||||
lock_one = await _mock_doorsense_enabled_august_lock_detail(hass)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue