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

        state = self.hass.states.get('proximity.home')
        assert state.state == 'not set'
        assert state.attributes.get('nearest') == 'not set'
        assert state.attributes.get('dir_of_travel') == 'not set'

        self.hass.states.set('proximity.home', '0')
        self.hass.pool.block_till_done()
        state = self.hass.states.get('proximity.home')
        assert state.state == '0'
Test the proximity.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/test_proximity.py/TestProximity.test_proximity