def test_passing_variables(self):
    'Test different ways of passing in variables.'
    calls = []
    context = Context()

    @callback
    def record_call(service):
        'Add recorded event to set.'
        calls.append(service)
    self.hass.services.register('test', 'script', record_call)
    assert setup_component(self.hass, 'script', {'script': {'test': {'sequence': {'service': 'test.script', 'data_template': {'hello': '{{ greeting }}'}}}}})
    turn_on(self.hass, ENTITY_ID, {'greeting': 'world'}, context=context)
    self.hass.block_till_done()
    assert (len(calls) == 1)
    assert (calls[0].context is context)
    assert (calls[0].data['hello'] == 'world')
    self.hass.services.call('script', 'test', {'greeting': 'universe'}, context=context)
    self.hass.block_till_done()
    assert (len(calls) == 2)
    assert (calls[1].context is context)
    assert (calls[1].data['hello'] == 'universe')
Test different ways of passing in variables.
def test_passing_variables(self):
    
    calls = []
    context = Context()

    @callback
    def record_call(service):
        'Add recorded event to set.'
        calls.append(service)
    self.hass.services.register('test', 'script', record_call)
    assert setup_component(self.hass, 'script', {'script': {'test': {'sequence': {'service': 'test.script', 'data_template': {'hello': '{{ greeting }}'}}}}})
    turn_on(self.hass, ENTITY_ID, {'greeting': 'world'}, context=context)
    self.hass.block_till_done()
    assert (len(calls) == 1)
    assert (calls[0].context is context)
    assert (calls[0].data['hello'] == 'world')
    self.hass.services.call('script', 'test', {'greeting': 'universe'}, context=context)
    self.hass.block_till_done()
    assert (len(calls) == 2)
    assert (calls[1].context is context)
    assert (calls[1].data['hello'] == 'universe')