diff --git a/tests/components/evil_genius_labs/conftest.py b/tests/components/evil_genius_labs/conftest.py index 3941917e130cc..081b7a5120a70 100644 --- a/tests/components/evil_genius_labs/conftest.py +++ b/tests/components/evil_genius_labs/conftest.py @@ -1,36 +1,44 @@ """Test helpers for Evil Genius Labs.""" -import json +from typing import Any from unittest.mock import patch import pytest +from typing_extensions import AsyncGenerator +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component +from homeassistant.util.json import JsonObjectType -from tests.common import MockConfigEntry, load_fixture +from tests.common import ( + MockConfigEntry, + load_json_array_fixture, + load_json_object_fixture, +) @pytest.fixture(scope="package") -def all_fixture(): +def all_fixture() -> dict[str, Any]: """Fixture data.""" - data = json.loads(load_fixture("data.json", "evil_genius_labs")) + data = load_json_array_fixture("data.json", "evil_genius_labs") return {item["name"]: item for item in data} @pytest.fixture(scope="package") -def info_fixture(): +def info_fixture() -> JsonObjectType: """Fixture info.""" - return json.loads(load_fixture("info.json", "evil_genius_labs")) + return load_json_object_fixture("info.json", "evil_genius_labs") @pytest.fixture(scope="package") -def product_fixture(): +def product_fixture() -> dict[str, str]: """Fixture info.""" return {"productName": "Fibonacci256"} @pytest.fixture -def config_entry(hass): +def config_entry(hass: HomeAssistant) -> MockConfigEntry: """Evil genius labs config entry.""" entry = MockConfigEntry(domain="evil_genius_labs", data={"host": "192.168.1.113"}) entry.add_to_hass(hass) @@ -39,8 +47,13 @@ def config_entry(hass): @pytest.fixture async def setup_evil_genius_labs( - hass, config_entry, all_fixture, info_fixture, product_fixture, platforms -): + hass: HomeAssistant, + config_entry: MockConfigEntry, + all_fixture: dict[str, Any], + info_fixture: JsonObjectType, + product_fixture: dict[str, str], + platforms: list[Platform], +) -> AsyncGenerator[None]: """Test up Evil Genius Labs instance.""" with ( patch(