def test_enter_and_exit(self, update_config):
        data = {
            'latitude': 40.7855,
            'longitude': -111.7367,
            'device': '123',
            'id': 'Home',
            'trigger': 'enter'
        }

        # Enter the Home
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)
        state_name = hass.states.get('{}.{}'.format('device_tracker',
                                                    data['device'])).state
        self.assertEqual(state_name, 'home')

        data['id'] = 'HOME'
        data['trigger'] = 'exit'

        # Exit Home
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)
        state_name = hass.states.get('{}.{}'.format('device_tracker',
                                                    data['device'])).state
        self.assertEqual(state_name, 'not_home')

        data['id'] = 'hOmE'
        data['trigger'] = 'enter'

        # Enter Home again
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)
        state_name = hass.states.get('{}.{}'.format('device_tracker',
                                                    data['device'])).state
        self.assertEqual(state_name, 'home')

        data['trigger'] = 'exit'

        # Exit Home
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)
        state_name = hass.states.get('{}.{}'.format('device_tracker',
                                                    data['device'])).state
        self.assertEqual(state_name, 'not_home')

        data['id'] = 'work'
        data['trigger'] = 'enter'

        # Enter Work
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)
        state_name = hass.states.get('{}.{}'.format('device_tracker',
                                                    data['device'])).state
        self.assertEqual(state_name, 'work')
Test when there is a known zone.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/device_tracker/test_locative.py/TestLocative.test_enter_and_exit