First pass fixing tests that raise exceptions caught by asyncio.gather (#25860)

* First pass fixing tests that raise exceptions caught by asyncio.gather

* Fix demo test

* lint
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2019-08-12 16:42:12 +02:00
1 parent 76f2e6015f
commit 6f357cb23e
18 files changed
+79 -14

No files matched your search

@@ -6,6 +6,7 @@ from asynctest import Mock, patch
from pysmartthings import APIResponseError
from homeassistant import data_entry_flow
from homeassistant.setup import async_setup_component
from homeassistant.components import cloud
from homeassistant.components.smartthings import smartapp
from homeassistant.components.smartthings.config_flow import SmartThingsFlowHandler
@@ -288,6 +289,7 @@ async def test_multiple_config_entry_created_when_installed(
hass, app, locations, installed_apps, smartthings_mock
):
"""Test a config entries are created for multiple installs."""
assert await async_setup_component(hass, "persistent_notification", {})
flow = SmartThingsFlowHandler()
flow.hass = hass
flow.access_token = str(uuid4())
@@ -6,6 +6,7 @@ from asynctest import Mock, patch
from pysmartthings import InstalledAppStatus, OAuthToken
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import cloud, smartthings
from homeassistant.components.smartthings.const import (
CONF_CLOUDHOOK_URL,
@@ -25,6 +26,7 @@ from tests.common import MockConfigEntry
async def test_migration_creates_new_flow(hass, smartthings_mock, config_entry):
"""Test migration deletes app and creates new flow."""
assert await async_setup_component(hass, "persistent_notification", {})
config_entry.version = 1
config_entry.add_to_hass(hass)
@@ -50,6 +52,7 @@ async def test_unrecoverable_api_errors_create_new_flow(
403 (forbidden/not found): Occurs when the app or installed app could
not be retrieved/found (likely deleted?)
"""
assert await async_setup_component(hass, "persistent_notification", {})
config_entry.add_to_hass(hass)
smartthings_mock.app.side_effect = ClientResponseError(None, None, status=401)