Clean up Google Config (#24663)
* Clean up Google Config * Lint * pylint * pylint2
This commit is contained in:
1 parent
0f5c9b4af3
commit
327fe63047
12 files changed
+460
-387
No files matched your search
@@ -1,24 +1,22 @@
|
||||
"""Tests for the cloud component."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.components import cloud
|
||||
from homeassistant.components.cloud import const
|
||||
|
||||
from jose import jwt
|
||||
|
||||
from tests.common import mock_coro
|
||||
|
||||
|
||||
def mock_cloud(hass, config={}):
|
||||
async def mock_cloud(hass, config=None):
|
||||
"""Mock cloud."""
|
||||
with patch('hass_nabucasa.Cloud.start', return_value=mock_coro()):
|
||||
assert hass.loop.run_until_complete(async_setup_component(
|
||||
hass, cloud.DOMAIN, {
|
||||
'cloud': config
|
||||
}))
|
||||
|
||||
hass.data[cloud.DOMAIN]._decode_claims = \
|
||||
lambda token: jwt.get_unverified_claims(token)
|
||||
assert await async_setup_component(
|
||||
hass, cloud.DOMAIN, {
|
||||
'cloud': config or {}
|
||||
})
|
||||
cloud_inst = hass.data['cloud']
|
||||
with patch('hass_nabucasa.Cloud.run_executor', return_value=mock_coro()):
|
||||
await cloud_inst.start()
|
||||
|
||||
|
||||
def mock_cloud_prefs(hass, prefs={}):
|
||||
|
||||
Reference in new issue
Block a user