Allow circular dependency with discovery (#2616)
This commit is contained in:
parent
9c76b30e24
commit
f1632496f0
10 changed files with 157 additions and 60 deletions
|
@ -2,7 +2,6 @@
|
|||
import json
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components import demo, device_tracker
|
||||
from homeassistant.remote import JSONEncoder
|
||||
|
@ -10,7 +9,6 @@ from homeassistant.remote import JSONEncoder
|
|||
from tests.common import mock_http_component, get_test_home_assistant
|
||||
|
||||
|
||||
@patch('homeassistant.components.sun.setup')
|
||||
class TestDemo(unittest.TestCase):
|
||||
"""Test the Demo component."""
|
||||
|
||||
|
@ -28,19 +26,19 @@ class TestDemo(unittest.TestCase):
|
|||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
def test_if_demo_state_shows_by_default(self, mock_sun_setup):
|
||||
def test_if_demo_state_shows_by_default(self):
|
||||
"""Test if demo state shows if we give no configuration."""
|
||||
demo.setup(self.hass, {demo.DOMAIN: {}})
|
||||
|
||||
self.assertIsNotNone(self.hass.states.get('a.Demo_Mode'))
|
||||
|
||||
def test_hiding_demo_state(self, mock_sun_setup):
|
||||
def test_hiding_demo_state(self):
|
||||
"""Test if you can hide the demo card."""
|
||||
demo.setup(self.hass, {demo.DOMAIN: {'hide_demo_state': 1}})
|
||||
|
||||
self.assertIsNone(self.hass.states.get('a.Demo_Mode'))
|
||||
|
||||
def test_all_entities_can_be_loaded_over_json(self, mock_sun_setup):
|
||||
def test_all_entities_can_be_loaded_over_json(self):
|
||||
"""Test if you can hide the demo card."""
|
||||
demo.setup(self.hass, {demo.DOMAIN: {'hide_demo_state': 1}})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue