mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 04:05:06 +02:00
Fix typos in tests
This commit is contained in:
@@ -718,22 +718,22 @@ async def test_subscribe_triggers(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
websocket_client: MockHAClientWebSocket,
|
websocket_client: MockHAClientWebSocket,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test get_triggers command."""
|
"""Test trigger_platforms/subscribe command."""
|
||||||
sun_service_descriptions = """
|
sun_trigger_descriptions = """
|
||||||
sun: {}
|
sun: {}
|
||||||
"""
|
"""
|
||||||
tag_service_descriptions = """
|
tag_trigger_descriptions = """
|
||||||
tag: {}
|
tag: {}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _load_yaml(fname, secrets=None):
|
def _load_yaml(fname, secrets=None):
|
||||||
if fname.endswith("sun/triggers.yaml"):
|
if fname.endswith("sun/triggers.yaml"):
|
||||||
service_descriptions = sun_service_descriptions
|
trigger_descriptions = sun_trigger_descriptions
|
||||||
elif fname.endswith("tag/triggers.yaml"):
|
elif fname.endswith("tag/triggers.yaml"):
|
||||||
service_descriptions = tag_service_descriptions
|
trigger_descriptions = tag_trigger_descriptions
|
||||||
else:
|
else:
|
||||||
raise FileNotFoundError
|
raise FileNotFoundError
|
||||||
with io.StringIO(service_descriptions) as file:
|
with io.StringIO(trigger_descriptions) as file:
|
||||||
return parse_yaml(file)
|
return parse_yaml(file)
|
||||||
|
|
||||||
mock_load_yaml.side_effect = _load_yaml
|
mock_load_yaml.side_effect = _load_yaml
|
||||||
|
@@ -442,7 +442,7 @@ async def test_pluggable_action(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"sun_service_descriptions",
|
"sun_trigger_descriptions",
|
||||||
[
|
[
|
||||||
"""
|
"""
|
||||||
sun:
|
sun:
|
||||||
@@ -476,10 +476,10 @@ async def test_pluggable_action(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_async_get_all_descriptions(
|
async def test_async_get_all_descriptions(
|
||||||
hass: HomeAssistant, sun_service_descriptions: str
|
hass: HomeAssistant, sun_trigger_descriptions: str
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test async_get_all_descriptions."""
|
"""Test async_get_all_descriptions."""
|
||||||
tag_service_descriptions = """
|
tag_trigger_descriptions = """
|
||||||
tag: {}
|
tag: {}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -489,10 +489,10 @@ async def test_async_get_all_descriptions(
|
|||||||
|
|
||||||
def _load_yaml(fname, secrets=None):
|
def _load_yaml(fname, secrets=None):
|
||||||
if fname.endswith("sun/triggers.yaml"):
|
if fname.endswith("sun/triggers.yaml"):
|
||||||
service_descriptions = sun_service_descriptions
|
trigger_descriptions = sun_trigger_descriptions
|
||||||
elif fname.endswith("tag/triggers.yaml"):
|
elif fname.endswith("tag/triggers.yaml"):
|
||||||
service_descriptions = tag_service_descriptions
|
trigger_descriptions = tag_trigger_descriptions
|
||||||
with io.StringIO(service_descriptions) as file:
|
with io.StringIO(trigger_descriptions) as file:
|
||||||
return parse_yaml(file)
|
return parse_yaml(file)
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
Reference in New Issue
Block a user