Retry keyset cloud (#12270)

* Use less threads in helpers.event tests

* Add helpers.event.async_call_later

* Cloud: retry fetching keyset
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-02-10 11:40:24 +01:00
1 parent 134445f622
commit f2296e1ff8
6 files changed
+66 -40

No files matched your search

+2 -2
View File
@@ -14,8 +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',
return_value=mock_coro(True)):
with patch('homeassistant.components.cloud.Cloud.async_start',
return_value=mock_coro()):
hass.loop.run_until_complete(async_setup_component(hass, 'cloud', {
'cloud': {
'mode': 'development',
+1 -1
View File
@@ -87,7 +87,7 @@ def test_initialize_loads_info(mock_os, hass):
with patch('homeassistant.components.cloud.open', mopen, create=True), \
patch('homeassistant.components.cloud.Cloud._decode_claims'):
cl._start_cloud(None)
yield from cl.async_start(None)
assert cl.id_token == 'test-id-token'
assert cl.access_token == 'test-access-token'
+4 -4
View File
@@ -266,8 +266,8 @@ def test_handler_alexa(hass):
hass.states.async_set(
'switch.test2', 'on', {'friendly_name': "Test switch 2"})
with patch('homeassistant.components.cloud.Cloud.initialize',
return_value=mock_coro(True)):
with patch('homeassistant.components.cloud.Cloud.async_start',
return_value=mock_coro()):
setup = yield from async_setup_component(hass, 'cloud', {
'cloud': {
'alexa': {
@@ -309,8 +309,8 @@ def test_handler_google_actions(hass):
hass.states.async_set(
'switch.test2', 'on', {'friendly_name': "Test switch 2"})
with patch('homeassistant.components.cloud.Cloud.initialize',
return_value=mock_coro(True)):
with patch('homeassistant.components.cloud.Cloud.async_start',
return_value=mock_coro()):
setup = yield from async_setup_component(hass, 'cloud', {
'cloud': {
'google_actions': {