def test_if_fires_on_zone_enter(self):
        self.hass.states.set('test.entity', 'hello', {
            'latitude': 32.881011,
            'longitude': -117.234758
        })
        self.hass.pool.block_till_done()

        assert _setup_component(self.hass, automation.DOMAIN, {
            automation.DOMAIN: {
                'trigger': {
                    'platform': 'zone',
                    'entity_id': 'test.entity',
                    'zone': 'zone.test',
                    'event': 'enter',
                },
                'action': {
                    'service': 'test.automation',
                    'data_template': {
                        'some': '{{ trigger.%s }}' % '}} - {{ trigger.'.join((
                                    'platform', 'entity_id',
                                    'from_state.state', 'to_state.state',
                                    'zone.name'))
                    },

                }
            }
        })

        self.hass.states.set('test.entity', 'hello', {
            'latitude': 32.880586,
            'longitude': -117.237564
        })
        self.hass.pool.block_till_done()

        self.assertEqual(1, len(self.calls))
        self.assertEqual(
            'zone - test.entity - hello - hello - test',
            self.calls[0].data['some'])
Test for firing on zone enter.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/automation/test_zone.py/TestAutomationZone.test_if_fires_on_zone_enter