1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add typing to tests with single hass argument (2) (#87675)

* Add typing to tests with single hass argument (2)

* a few more
This commit is contained in:
epenet
2023-02-08 08:51:43 +01:00
committed by GitHub
parent 1bbc03d0ba
commit c98b4e3204
50 changed files with 816 additions and 671 deletions

View File

@@ -6,6 +6,7 @@ import logging
import pytest
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
collection,
entity_component,
@@ -188,7 +189,7 @@ async def test_yaml_collection_skipping_duplicate_ids() -> None:
)
async def test_storage_collection(hass):
async def test_storage_collection(hass: HomeAssistant) -> None:
"""Test storage collection."""
store = storage.Store(hass, 1, "test-data")
await store.async_save(
@@ -251,7 +252,7 @@ async def test_storage_collection(hass):
}
async def test_attach_entity_component_collection(hass):
async def test_attach_entity_component_collection(hass: HomeAssistant) -> None:
"""Test attaching collection to entity component."""
ent_comp = entity_component.EntityComponent(_LOGGER, "test", hass)
coll = MockObservableCollection(_LOGGER)
@@ -290,7 +291,7 @@ async def test_attach_entity_component_collection(hass):
assert hass.states.get("test.mock_1") is None
async def test_entity_component_collection_abort(hass):
async def test_entity_component_collection_abort(hass: HomeAssistant) -> None:
"""Test aborted entity adding is handled."""
ent_comp = entity_component.EntityComponent(_LOGGER, "test", hass)
coll = MockObservableCollection(_LOGGER)
@@ -356,7 +357,7 @@ async def test_entity_component_collection_abort(hass):
assert len(async_remove_calls) == 0
async def test_entity_component_collection_entity_removed(hass):
async def test_entity_component_collection_entity_removed(hass: HomeAssistant) -> None:
"""Test entity removal is handled."""
ent_comp = entity_component.EntityComponent(_LOGGER, "test", hass)
coll = MockObservableCollection(_LOGGER)