Undecorate RenderInfo result property (#39108)

pull/39570/head
J. Nick Koston 2020-09-02 03:35:15 -05:00 committed by GitHub
parent 3e9963a216
commit e55a014e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -680,7 +680,7 @@ class _TrackTemplateResultInfo:
info_changed = True
try:
result: Union[str, TemplateError] = self._info[template].result
result: Union[str, TemplateError] = self._info[template].result()
except TemplateError as ex:
result = ex

View File

@ -175,7 +175,6 @@ class RenderInfo:
split_entity_id(entity_id)[0] in self.domains or entity_id in self.entities
)
@property
def result(self) -> str:
"""Results of the template computation."""
if self.exception is not None:

View File

@ -51,7 +51,7 @@ def extract_entities(hass, template_str, variables=None):
def assert_result_info(info, result, entities=None, domains=None, all_states=False):
"""Check result info."""
assert info.result == result
assert info.result() == result
assert info.all_states == all_states
assert info.filter_lifecycle("invalid_entity_name.somewhere") == all_states
if entities is not None:
@ -96,7 +96,7 @@ def test_invalid_template(hass):
info = tmpl.async_render_to_info()
with pytest.raises(TemplateError):
assert info.result == "impossible"
assert info.result() == "impossible"
tmpl = template.Template("{{states(keyword)}}", hass)