Add cloud pref for Google unlock (#18600)

This commit is contained in:
Paulus Schoutsen 2018-11-20 23:23:07 +01:00 committed by GitHub
parent b7742999cf
commit d9c7f777c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 103 additions and 66 deletions

View file

@ -7,8 +7,9 @@ import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components.cloud import (
Cloud, iot, auth_api, MODE_DEV, STORAGE_ENABLE_ALEXA,
STORAGE_ENABLE_GOOGLE)
Cloud, iot, auth_api, MODE_DEV)
from homeassistant.components.cloud.const import (
PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE)
from tests.components.alexa import test_smart_home as test_alexa
from tests.common import mock_coro
@ -308,7 +309,7 @@ def test_handler_alexa(hass):
@asyncio.coroutine
def test_handler_alexa_disabled(hass, mock_cloud_fixture):
"""Test handler Alexa when user has disabled it."""
mock_cloud_fixture[STORAGE_ENABLE_ALEXA] = False
mock_cloud_fixture[PREF_ENABLE_ALEXA] = False
resp = yield from iot.async_handle_alexa(
hass, hass.data['cloud'],
@ -377,7 +378,7 @@ def test_handler_google_actions(hass):
async def test_handler_google_actions_disabled(hass, mock_cloud_fixture):
"""Test handler Google Actions when user has disabled it."""
mock_cloud_fixture[STORAGE_ENABLE_GOOGLE] = False
mock_cloud_fixture[PREF_ENABLE_GOOGLE] = False
with patch('homeassistant.components.cloud.Cloud.async_start',
return_value=mock_coro()):