Remove unused calls fixture from template tests (#71735)
This commit is contained in:
parent
1ef3800844
commit
b70e97e949
4 changed files with 17 additions and 48 deletions
|
@ -1,6 +1,4 @@
|
|||
"""The tests for the Template select platform."""
|
||||
import pytest
|
||||
|
||||
from homeassistant import setup
|
||||
from homeassistant.components.input_select import (
|
||||
ATTR_OPTION as INPUT_SELECT_ATTR_OPTION,
|
||||
|
@ -19,24 +17,14 @@ from homeassistant.const import ATTR_ICON, CONF_ENTITY_ID, STATE_UNKNOWN
|
|||
from homeassistant.core import Context
|
||||
from homeassistant.helpers.entity_registry import async_get
|
||||
|
||||
from tests.common import (
|
||||
assert_setup_component,
|
||||
async_capture_events,
|
||||
async_mock_service,
|
||||
)
|
||||
from tests.common import assert_setup_component, async_capture_events
|
||||
|
||||
_TEST_SELECT = "select.template_select"
|
||||
# Represent for select's current_option
|
||||
_OPTION_INPUT_SELECT = "input_select.option"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def calls(hass):
|
||||
"""Track calls to a mock service."""
|
||||
return async_mock_service(hass, "test", "automation")
|
||||
|
||||
|
||||
async def test_missing_optional_config(hass, calls):
|
||||
async def test_missing_optional_config(hass):
|
||||
"""Test: missing optional template is ok."""
|
||||
with assert_setup_component(1, "template"):
|
||||
assert await setup.async_setup_component(
|
||||
|
@ -60,7 +48,7 @@ async def test_missing_optional_config(hass, calls):
|
|||
_verify(hass, "a", ["a", "b"])
|
||||
|
||||
|
||||
async def test_multiple_configs(hass, calls):
|
||||
async def test_multiple_configs(hass):
|
||||
"""Test: multiple select entities get created."""
|
||||
with assert_setup_component(1, "template"):
|
||||
assert await setup.async_setup_component(
|
||||
|
@ -92,7 +80,7 @@ async def test_multiple_configs(hass, calls):
|
|||
_verify(hass, "a", ["a", "b"], f"{_TEST_SELECT}_2")
|
||||
|
||||
|
||||
async def test_missing_required_keys(hass, calls):
|
||||
async def test_missing_required_keys(hass):
|
||||
"""Test: missing required fields will fail."""
|
||||
with assert_setup_component(0, "template"):
|
||||
assert await setup.async_setup_component(
|
||||
|
@ -143,7 +131,7 @@ async def test_missing_required_keys(hass, calls):
|
|||
assert hass.states.async_all("select") == []
|
||||
|
||||
|
||||
async def test_templates_with_entities(hass, calls):
|
||||
async def test_templates_with_entities(hass):
|
||||
"""Test templates with values from other entities."""
|
||||
with assert_setup_component(1, "input_select"):
|
||||
assert await setup.async_setup_component(
|
||||
|
@ -290,7 +278,7 @@ def _verify(hass, expected_current_option, expected_options, entity_name=_TEST_S
|
|||
assert attributes.get(SELECT_ATTR_OPTIONS) == expected_options
|
||||
|
||||
|
||||
async def test_template_icon_with_entities(hass, calls):
|
||||
async def test_template_icon_with_entities(hass):
|
||||
"""Test templates with values from other entities."""
|
||||
with assert_setup_component(1, "input_select"):
|
||||
assert await setup.async_setup_component(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue