mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Add type hints to core tests (#88478)
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user