Services (small_pr)(fix): Added missing return on data template error (#12184)
* Added return on data template error * Rebased so not sure why spelling errors returned...
This commit is contained in:
parent
137933a774
commit
f5030d9ebf
2 changed files with 19 additions and 0 deletions
|
@ -68,6 +68,24 @@ class TestServiceHelpers(unittest.TestCase):
|
|||
|
||||
self.assertEqual('goodbye', self.calls[0].data['hello'])
|
||||
|
||||
def test_bad_template(self):
|
||||
"""Test passing bad template."""
|
||||
config = {
|
||||
'service_template': '{{ var_service }}',
|
||||
'entity_id': 'hello.world',
|
||||
'data_template': {
|
||||
'hello': '{{ states + unknown_var }}'
|
||||
}
|
||||
}
|
||||
|
||||
service.call_from_config(self.hass, config, variables={
|
||||
'var_service': 'test_domain.test_service',
|
||||
'var_data': 'goodbye',
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
self.assertEqual(len(self.calls), 0)
|
||||
|
||||
def test_split_entity_string(self):
|
||||
"""Test splitting of entity string."""
|
||||
service.call_from_config(self.hass, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue