Code styling tweaks to the tests - Part 1 (#86192)
This commit is contained in:
parent
79b52a2b41
commit
24fdd588fd
50 changed files with 552 additions and 251 deletions
|
@ -144,8 +144,10 @@ async def test_update_with_json_attrs(hass: HomeAssistant) -> None:
|
|||
await setup_test_entities(
|
||||
hass,
|
||||
{
|
||||
"command": 'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\":\
|
||||
\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }',
|
||||
"command": (
|
||||
'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\": '
|
||||
'\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }'
|
||||
),
|
||||
"json_attributes": ["key", "another_key", "key_three"],
|
||||
},
|
||||
)
|
||||
|
@ -218,8 +220,10 @@ async def test_update_with_missing_json_attrs(
|
|||
await setup_test_entities(
|
||||
hass,
|
||||
{
|
||||
"command": 'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\":\
|
||||
\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }',
|
||||
"command": (
|
||||
'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\": '
|
||||
'\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }'
|
||||
),
|
||||
"json_attributes": ["key", "another_key", "key_three", "missing_key"],
|
||||
},
|
||||
)
|
||||
|
@ -239,8 +243,10 @@ async def test_update_with_unnecessary_json_attrs(
|
|||
await setup_test_entities(
|
||||
hass,
|
||||
{
|
||||
"command": 'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\":\
|
||||
\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }',
|
||||
"command": (
|
||||
'echo { \\"key\\": \\"some_json_value\\", \\"another_key\\": '
|
||||
'\\"another_json_value\\", \\"key_three\\": \\"value_three\\" }'
|
||||
),
|
||||
"json_attributes": ["key", "another_key"],
|
||||
},
|
||||
)
|
||||
|
|
|
@ -93,7 +93,9 @@ async def test_state_value(hass: HomeAssistant) -> None:
|
|||
"command_on": f"echo 1 > {path}",
|
||||
"command_off": f"echo 0 > {path}",
|
||||
"value_template": '{{ value=="1" }}',
|
||||
"icon_template": '{% if value=="1" %} mdi:on {% else %} mdi:off {% endif %}',
|
||||
"icon_template": (
|
||||
'{% if value=="1" %} mdi:on {% else %} mdi:off {% endif %}'
|
||||
),
|
||||
}
|
||||
},
|
||||
)
|
||||
|
@ -142,7 +144,10 @@ async def test_state_json_value(hass: HomeAssistant) -> None:
|
|||
"command_on": f"echo '{oncmd}' > {path}",
|
||||
"command_off": f"echo '{offcmd}' > {path}",
|
||||
"value_template": '{{ value_json.status=="ok" }}',
|
||||
"icon_template": '{% if value_json.status=="ok" %} mdi:on {% else %} mdi:off {% endif %}',
|
||||
"icon_template": (
|
||||
'{% if value_json.status=="ok" %} mdi:on'
|
||||
"{% else %} mdi:off {% endif %}"
|
||||
),
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue