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

        # Enter Home
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)

        state = hass.states.get('{}.{}'.format('device_tracker',
                                               data['device']))
        self.assertEqual(state.state, 'home')

        data['id'] = 'Work'

        # Enter Work
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)

        state = hass.states.get('{}.{}'.format('device_tracker',
                                               data['device']))
        self.assertEqual(state.state, 'work')

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

        # Exit Home
        req = requests.get(_url(data))
        self.assertEqual(200, req.status_code)

        state = hass.states.get('{}.{}'.format('device_tracker',
                                               data['device']))
        self.assertEqual(state.state, 'work')
Refresh the access_token using the refresh_token.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/device_tracker/test_locative.py/TestLocative.test_exit_after_enter--crossover with--dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py/OAuth2Token._refresh