Consolidate frontend (#9915)

* Consolidate frontend

* Remove home-assistant-polymer submodule

* Convert to using a pypi package for frontend

* fix release script

* Lint

* Remove unused file

* Remove frontend related scripts

* Move hass_frontend to frontend REQUIREMENTS

* Fix tests

* lint

* Address comments

* Lint + fix tests in py34

* Fix py34 tests again

* fix typo
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-10-24 19:36:27 -07:00
1 parent 29fb65b224
commit 2bdad5388b
169 files changed
+372 -5396

No files matched your search

+8 -16
View File
@@ -7,7 +7,7 @@ import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components.frontend import (
DOMAIN, ATTR_THEMES, ATTR_EXTRA_HTML_URL, DATA_PANELS, register_panel)
DOMAIN, CONF_THEMES, CONF_EXTRA_HTML_URL, DATA_PANELS)
@pytest.fixture
@@ -22,7 +22,7 @@ def mock_http_client_with_themes(hass, test_client):
"""Start the Hass HTTP component."""
hass.loop.run_until_complete(async_setup_component(hass, 'frontend', {
DOMAIN: {
ATTR_THEMES: {
CONF_THEMES: {
'happy': {
'primary-color': 'red'
}
@@ -36,7 +36,7 @@ def mock_http_client_with_urls(hass, test_client):
"""Start the Hass HTTP component."""
hass.loop.run_until_complete(async_setup_component(hass, 'frontend', {
DOMAIN: {
ATTR_EXTRA_HTML_URL: ["https://domain.com/my_extra_url.html"]
CONF_EXTRA_HTML_URL: ["https://domain.com/my_extra_url.html"]
}}))
return hass.loop.run_until_complete(test_client(hass.http.app))
@@ -133,7 +133,7 @@ def test_themes_reload_themes(hass, mock_http_client_with_themes):
"""Test frontend.reload_themes service."""
with patch('homeassistant.components.frontend.load_yaml_config_file',
return_value={DOMAIN: {
ATTR_THEMES: {
CONF_THEMES: {
'sad': {'primary-color': 'blue'}
}}}):
yield from hass.services.async_call(DOMAIN, 'set_theme',
@@ -168,15 +168,7 @@ def test_extra_urls(mock_http_client_with_urls):
@asyncio.coroutine
def test_panel_without_path(hass):
"""Test panel registration without file path."""
register_panel(hass, 'test_component', 'nonexistant_file')
assert hass.data[DATA_PANELS] == {}
@asyncio.coroutine
def test_panel_with_url(hass):
"""Test panel registration without file path."""
register_panel(hass, 'test_component', None, url='some_url')
assert hass.data[DATA_PANELS] == {
'test_component': {'component_name': 'test_component',
'url': 'some_url',
'url_path': 'test_component'}}
yield from hass.components.frontend.async_register_panel(
'test_component', 'nonexistant_file')
yield from async_setup_component(hass, 'frontend', {})
assert 'test_component' not in hass.data[DATA_PANELS]