Make themes API work even when themes are not defined. (#8473)

This commit is contained in:
Andrey authored and Paulus Schoutsen committed 2017-07-15 19:43:06 -07:00
1 parent 84ca4d2a21
commit 3377f30613
2 files changed
+17 -4

No files matched your search

+10
View File
@@ -133,3 +133,13 @@ def test_themes_reload_themes(hass, mock_http_client_with_themes):
json = yield from resp.json()
assert json['themes'] == {'sad': {'primary-color': 'blue'}}
assert json['default_theme'] == 'default'
@asyncio.coroutine
def test_missing_themes(mock_http_client):
"""Test that themes API works when themes are not defined."""
resp = yield from mock_http_client.get('/api/themes')
assert resp.status == 200
json = yield from resp.json()
assert json['default_theme'] == 'default'
assert json['themes'] == {}