mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Improve type hints in rainforest_eagle tests (#123880)
This commit is contained in:
parent
ac223e64f9
commit
8117532cc7
@ -1,6 +1,7 @@
|
|||||||
"""Conftest for rainforest_eagle."""
|
"""Conftest for rainforest_eagle."""
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock, patch
|
from collections.abc import AsyncGenerator
|
||||||
|
from unittest.mock import AsyncMock, MagicMock, Mock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ from homeassistant.components.rainforest_eagle.const import (
|
|||||||
TYPE_EAGLE_200,
|
TYPE_EAGLE_200,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST, CONF_TYPE
|
from homeassistant.const import CONF_HOST, CONF_TYPE
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from . import MOCK_200_RESPONSE_WITHOUT_PRICE, MOCK_CLOUD_ID
|
from . import MOCK_200_RESPONSE_WITHOUT_PRICE, MOCK_CLOUD_ID
|
||||||
@ -21,7 +23,7 @@ from tests.common import MockConfigEntry
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def config_entry_200(hass):
|
def config_entry_200(hass: HomeAssistant) -> MockConfigEntry:
|
||||||
"""Return a config entry."""
|
"""Return a config entry."""
|
||||||
entry = MockConfigEntry(
|
entry = MockConfigEntry(
|
||||||
domain="rainforest_eagle",
|
domain="rainforest_eagle",
|
||||||
@ -38,7 +40,9 @@ def config_entry_200(hass):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def setup_rainforest_200(hass, config_entry_200):
|
async def setup_rainforest_200(
|
||||||
|
hass: HomeAssistant, config_entry_200: MockConfigEntry
|
||||||
|
) -> AsyncGenerator[Mock]:
|
||||||
"""Set up rainforest."""
|
"""Set up rainforest."""
|
||||||
with patch(
|
with patch(
|
||||||
"aioeagle.ElectricMeter.create_instance",
|
"aioeagle.ElectricMeter.create_instance",
|
||||||
@ -53,7 +57,7 @@ async def setup_rainforest_200(hass, config_entry_200):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def setup_rainforest_100(hass):
|
async def setup_rainforest_100(hass: HomeAssistant) -> AsyncGenerator[MagicMock]:
|
||||||
"""Set up rainforest."""
|
"""Set up rainforest."""
|
||||||
MockConfigEntry(
|
MockConfigEntry(
|
||||||
domain="rainforest_eagle",
|
domain="rainforest_eagle",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user