Add experimental UI backend (#15002)

* Add experimental UI

* Add test

* Lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-06-16 17:12:03 -04:00
1 parent c5f012c85a
commit 00cbdffa12
2 files changed
+46 -4

No files matched your search

+19
View File
@@ -278,3 +278,22 @@ async def test_get_translations(hass, hass_ws_client):
assert msg['type'] == wapi.TYPE_RESULT
assert msg['success']
assert msg['result'] == {'resources': {'lang': 'nl'}}
async def test_experimental_ui(hass, hass_ws_client):
"""Test experimental_ui command."""
await async_setup_component(hass, 'frontend')
client = await hass_ws_client(hass)
with patch('homeassistant.components.frontend.load_yaml',
return_value={'hello': 'world'}):
await client.send_json({
'id': 5,
'type': 'frontend/experimental_ui',
})
msg = await client.receive_json()
assert msg['id'] == 5
assert msg['type'] == wapi.TYPE_RESULT
assert msg['success']
assert msg['result'] == {'hello': 'world'}