'Test for firing on zone leave.'

def test_if_fires_on_zone_leave(self):

    self.hass.states.set('test.entity', 'hello', {'latitude': 32.880586, 'longitude': (-117.237564)})
    self.hass.block_till_done()
    assert setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'zone', 'entity_id': 'test.entity', 'zone': 'zone.test', 'event': 'leave'}, 'action': {'service': 'test.automation'}}})
    self.hass.states.set('test.entity', 'hello', {'latitude': 32.881011, 'longitude': (-117.234758)})
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
