Add type hints to core tests (#88478)

This commit is contained in:
epenet
2023-02-20 11:42:56 +01:00
committed by GitHub
parent 26755a6841
commit 5f25b71df7
59 changed files with 1068 additions and 547 deletions

View File

@@ -1,10 +1,12 @@
"""Tests for instance ID helper."""
from typing import Any
from unittest.mock import patch
from homeassistant.core import HomeAssistant
from homeassistant.helpers import instance_id
async def test_get_id_empty(hass, hass_storage):
async def test_get_id_empty(hass: HomeAssistant, hass_storage: dict[str, Any]) -> None:
"""Get unique ID."""
uuid = await instance_id.async_get(hass)
assert uuid is not None
@@ -12,7 +14,9 @@ async def test_get_id_empty(hass, hass_storage):
assert hass_storage["core.uuid"]["data"]["uuid"] == uuid
async def test_get_id_migrate(hass, hass_storage):
async def test_get_id_migrate(
hass: HomeAssistant, hass_storage: dict[str, Any]
) -> None:
"""Migrate existing file."""
with patch(
"homeassistant.util.json.load_json", return_value={"uuid": "1234"}