'Test the calling of a service.'

def test_calling_service(self):

    calls = []
    @callback
    def record_call(service):
        'Add    recorded    event    to    set.'
        calls.append(service)
    self.hass.services.register('test', 'script', record_call)
    script.call_from_config(self.hass, {'service': 'test.script', 'data': {'hello': 'world'}})
    self.hass.block_till_done()
    assert (len(calls) == 1)
    assert (calls[0].data.get('hello') == 'world')
