def test_device_trackers_in_zone(self):
        assert proximity.setup(self.hass, {
            'proximity': {
                'zone': 'home',
                'ignored_zones': {
                    'work'
                },
                'devices': {
                    'device_tracker.test1',
                    'device_tracker.test2'
                },
                'tolerance': '1'
            }
        })

        self.hass.states.set(
            'device_tracker.test1', 'home',
            {
                'friendly_name': 'test1',
                'latitude': 2.1,
                'longitude': 1.1
            })
        self.hass.pool.block_till_done()
        self.hass.states.set(
            'device_tracker.test2', 'home',
            {
                'friendly_name': 'test2',
                'latitude': 2.1,
                'longitude': 1.1
            })
        self.hass.pool.block_till_done()
        state = self.hass.states.get('proximity.home')
        assert state.state == '0'
        assert ((state.attributes.get('nearest') == 'test1, test2') or
                (state.attributes.get('nearest') == 'test2, test1'))
        assert state.attributes.get('dir_of_travel') == 'arrived'
Open the search index.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/test_proximity.py/TestProximity.test_device_trackers_in_zone--crossover with--dataset/ETHPy150Open mblayman/markwiki/markwiki/search/engine.py/SearchEngine.open_index