Cloud Updates (#11404)

* Verify stored keys on startup

* Handle Google Assistant messages

* Fix tests

* Don't verify expiration when getting claims

* Remove email based check

* Lint

* Lint

* Lint
This commit is contained in:
Paulus Schoutsen 2018-01-03 10:16:59 -08:00 committed by Pascal Vizeli
parent 86e1d0f952
commit f314b6cb6c
7 changed files with 178 additions and 108 deletions

View file

@ -14,7 +14,8 @@ from tests.common import mock_coro
@pytest.fixture
def cloud_client(hass, test_client):
"""Fixture that can fetch from the cloud client."""
with patch('homeassistant.components.cloud.Cloud.initialize'):
with patch('homeassistant.components.cloud.Cloud.initialize',
return_value=mock_coro(True)):
hass.loop.run_until_complete(async_setup_component(hass, 'cloud', {
'cloud': {
'mode': 'development',
@ -24,6 +25,8 @@ def cloud_client(hass, test_client):
'relayer': 'relayer',
}
}))
hass.data['cloud']._decode_claims = \
lambda token: jwt.get_unverified_claims(token)
with patch('homeassistant.components.cloud.Cloud.write_user_info'):
yield hass.loop.run_until_complete(test_client(hass.http.app))