Upgrade wled 0.4.1 (#36091)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-06-03 02:29:49 +02:00
1 parent 94a9b364b0
commit d2e6b863b7
8 files changed
+36 -24

No files matched your search

+10 -4
View File
@@ -1,5 +1,6 @@
"""Tests for the WLED config flow."""
import aiohttp
from wled import WLEDConnectionError
from homeassistant import data_entry_flow
from homeassistant.components.wled import config_flow
@@ -9,6 +10,7 @@ from homeassistant.core import HomeAssistant
from . import init_integration
from tests.async_mock import MagicMock, patch
from tests.common import load_fixture
from tests.test_util.aiohttp import AiohttpClientMocker
@@ -59,8 +61,9 @@ async def test_show_zerconf_form(
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
@patch("homeassistant.components.wled.WLED.update", side_effect=WLEDConnectionError)
async def test_connection_error(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
update_mock: MagicMock, hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we show user form on WLED connection error."""
aioclient_mock.get("http://example.com/json/", exc=aiohttp.ClientError)
@@ -76,8 +79,9 @@ async def test_connection_error(
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
@patch("homeassistant.components.wled.WLED.update", side_effect=WLEDConnectionError)
async def test_zeroconf_connection_error(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
update_mock: MagicMock, hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort zeroconf flow on WLED connection error."""
aioclient_mock.get("http://192.168.1.123/json/", exc=aiohttp.ClientError)
@@ -92,8 +96,9 @@ async def test_zeroconf_connection_error(
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
@patch("homeassistant.components.wled.WLED.update", side_effect=WLEDConnectionError)
async def test_zeroconf_confirm_connection_error(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
update_mock: MagicMock, hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort zeroconf flow on WLED connection error."""
aioclient_mock.get("http://192.168.1.123:80/json/", exc=aiohttp.ClientError)
@@ -112,8 +117,9 @@ async def test_zeroconf_confirm_connection_error(
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
@patch("homeassistant.components.wled.WLED.update", side_effect=WLEDConnectionError)
async def test_zeroconf_no_data(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
update_mock: MagicMock, hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort if zeroconf provides no data."""
flow = config_flow.WLEDFlowHandler()