Add HEOS sign-in/out services (#23729)
* Add HEOS sign-in/out services * Fix typo in comment
This commit is contained in:
parent
102beaa044
commit
02d8731a61
9 changed files with 220 additions and 4 deletions
|
@ -744,6 +744,28 @@ class TestServiceRegistry(unittest.TestCase):
|
|||
self.hass.block_till_done()
|
||||
assert 1 == len(calls)
|
||||
|
||||
def test_async_service_partial(self):
|
||||
"""Test registering and calling an wrapped async service."""
|
||||
calls = []
|
||||
|
||||
async def service_handler(call):
|
||||
"""Service handler coroutine."""
|
||||
calls.append(call)
|
||||
|
||||
self.services.register(
|
||||
'test_domain', 'register_calls',
|
||||
functools.partial(service_handler))
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert len(self.calls_register) == 1
|
||||
assert self.calls_register[-1].data['domain'] == 'test_domain'
|
||||
assert self.calls_register[-1].data['service'] == 'register_calls'
|
||||
|
||||
assert self.services.call('test_domain', 'REGISTER_CALLS',
|
||||
blocking=True)
|
||||
self.hass.block_till_done()
|
||||
assert len(calls) == 1
|
||||
|
||||
def test_callback_service(self):
|
||||
"""Test registering and calling an async service."""
|
||||
calls = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue