def test_calling_service(self):
        calls = []

        def record_call(service):
            """Add recorded event to set."""
            calls.append(service)

        self.hass.services.register('test', 'script', record_call)

        script_obj = script.Script(self.hass, {
            'service': 'test.script',
            'data': {
                'hello': 'world'
            }
        })

        script_obj.run()
        self.hass.pool.block_till_done()

        assert len(calls) == 1
        assert calls[0].data.get('hello') == 'world'
Test the calling of a service.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_script.py/TestScriptHelper.test_calling_service