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

Extract label template functions into a label Jinja2 extension (#156439)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Franck Nijhof
2025-11-14 11:04:31 +01:00
committed by GitHub
parent 34c1d45ee0
commit f484b6df0d
7 changed files with 623 additions and 522 deletions

View File

@@ -44,7 +44,13 @@ def assert_result_info(
all_states: bool = False,
) -> None:
"""Check result info."""
assert info.result() == result
actual = info.result()
assert actual == result, (
f"Template result mismatch:\n"
f" Expected: {result!r} (type: {type(result).__name__})\n"
f" Actual: {actual!r} (type: {type(actual).__name__})\n"
f" Template: {info.template!r}"
)
assert info.all_states == all_states
assert info.filter("invalid_entity_name.somewhere") == all_states
if entities is not None: