mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
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:
@@ -1,15 +1,18 @@
|
||||
"""Test Alexa entity representation."""
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.alexa import smart_home
|
||||
from homeassistant.const import __version__
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
|
||||
from .test_common import get_default_config, get_new_request
|
||||
|
||||
|
||||
async def test_unsupported_domain(hass):
|
||||
async def test_unsupported_domain(hass: HomeAssistant) -> None:
|
||||
"""Discovery ignores entities of unknown domains."""
|
||||
request = get_new_request("Alexa.Discovery", "Discover")
|
||||
|
||||
@@ -23,7 +26,7 @@ async def test_unsupported_domain(hass):
|
||||
assert not msg["payload"]["endpoints"]
|
||||
|
||||
|
||||
async def test_categorized_hidden_entities(hass):
|
||||
async def test_categorized_hidden_entities(hass: HomeAssistant) -> None:
|
||||
"""Discovery ignores hidden and categorized entities."""
|
||||
entity_registry = er.async_get(hass)
|
||||
request = get_new_request("Alexa.Discovery", "Discover")
|
||||
@@ -71,7 +74,7 @@ async def test_categorized_hidden_entities(hass):
|
||||
assert not msg["payload"]["endpoints"]
|
||||
|
||||
|
||||
async def test_serialize_discovery(hass):
|
||||
async def test_serialize_discovery(hass: HomeAssistant) -> None:
|
||||
"""Test we handle an interface raising unexpectedly during serialize discovery."""
|
||||
request = get_new_request("Alexa.Discovery", "Discover")
|
||||
|
||||
@@ -91,7 +94,9 @@ async def test_serialize_discovery(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_serialize_discovery_recovers(hass, caplog):
|
||||
async def test_serialize_discovery_recovers(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Test we handle an interface raising unexpectedly during serialize discovery."""
|
||||
request = get_new_request("Alexa.Discovery", "Discover")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user