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

Revert "Ensure frontend is available if integrations fail to start - Part 1 of 2 (#36093)" (#36251)

This reverts commit fbe7b4ddfa.
This commit is contained in:
Pascal Vizeli
2020-05-29 10:18:39 +02:00
committed by GitHub
parent 08f2714e57
commit ed014e3c96
13 changed files with 63 additions and 173 deletions

View File

@@ -4,7 +4,6 @@ import unittest
from homeassistant import setup
from homeassistant.components import frontend
from tests.async_mock import patch
from tests.common import get_test_home_assistant
@@ -27,42 +26,38 @@ class TestPanelIframe(unittest.TestCase):
]
for conf in to_try:
with patch(
"homeassistant.components.http.start_http_server_and_save_config"
):
assert not setup.setup_component(
self.hass, "panel_iframe", {"panel_iframe": conf}
)
assert not setup.setup_component(
self.hass, "panel_iframe", {"panel_iframe": conf}
)
def test_correct_config(self):
"""Test correct config."""
with patch("homeassistant.components.http.start_http_server_and_save_config"):
assert setup.setup_component(
self.hass,
"panel_iframe",
{
"panel_iframe": {
"router": {
"icon": "mdi:network-wireless",
"title": "Router",
"url": "http://192.168.1.1",
"require_admin": True,
},
"weather": {
"icon": "mdi:weather",
"title": "Weather",
"url": "https://www.wunderground.com/us/ca/san-diego",
"require_admin": True,
},
"api": {"icon": "mdi:weather", "title": "Api", "url": "/api"},
"ftp": {
"icon": "mdi:weather",
"title": "FTP",
"url": "ftp://some/ftp",
},
}
},
)
assert setup.setup_component(
self.hass,
"panel_iframe",
{
"panel_iframe": {
"router": {
"icon": "mdi:network-wireless",
"title": "Router",
"url": "http://192.168.1.1",
"require_admin": True,
},
"weather": {
"icon": "mdi:weather",
"title": "Weather",
"url": "https://www.wunderground.com/us/ca/san-diego",
"require_admin": True,
},
"api": {"icon": "mdi:weather", "title": "Api", "url": "/api"},
"ftp": {
"icon": "mdi:weather",
"title": "FTP",
"url": "ftp://some/ftp",
},
}
},
)
panels = self.hass.data[frontend.DATA_PANELS]