1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Fix zone being setup twice

This commit is contained in:
Paulus Schoutsen
2016-09-24 00:04:03 -07:00
parent ac4e54c6ff
commit a1488b46f6
3 changed files with 34 additions and 44 deletions

View File

@@ -18,6 +18,18 @@ class TestComponentZone(unittest.TestCase):
"""Stop down everything that was started."""
self.hass.stop()
def test_setup_no_zones_still_adds_home_zone(self):
"""Test if no config is passed in we still get the home zone."""
assert bootstrap.setup_component(self.hass, zone.DOMAIN,
{'zone': None})
assert len(self.hass.states.entity_ids('zone')) == 1
state = self.hass.states.get('zone.home')
assert self.hass.config.location_name == state.name
assert self.hass.config.latitude == state.attributes['latitude']
assert self.hass.config.longitude == state.attributes['longitude']
assert not state.attributes.get('passive', False)
def test_setup(self):
"""Test setup."""
info = {