Add type hints to integration tests (j-m) (#87704)

This commit is contained in:
epenet 2023-02-08 19:06:59 +01:00 committed by GitHub
parent 630028106a
commit f75ac17554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 605 additions and 417 deletions

View file

@ -4,15 +4,20 @@ from unittest.mock import patch
import uuid
from homeassistant.components.lovelace import dashboard, resources
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.typing import WebSocketGenerator
RESOURCE_EXAMPLES = [
{"type": "js", "url": "/local/bla.js"},
{"type": "css", "url": "/local/bla.css"},
]
async def test_yaml_resources(hass, hass_ws_client):
async def test_yaml_resources(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None:
"""Test defining resources in configuration.yaml."""
assert await async_setup_component(
hass, "lovelace", {"lovelace": {"mode": "yaml", "resources": RESOURCE_EXAMPLES}}
@ -27,7 +32,9 @@ async def test_yaml_resources(hass, hass_ws_client):
assert response["result"] == RESOURCE_EXAMPLES
async def test_yaml_resources_backwards(hass, hass_ws_client):
async def test_yaml_resources_backwards(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None:
"""Test defining resources in YAML ll config (legacy)."""
with patch(
"homeassistant.components.lovelace.dashboard.load_yaml",