Update voluputous (#12463)
* Update voluputous * Fix http config * Fix optional with default=None * Optional, default=none * Fix defaults in voluptuous schemas * Fix tests * Fix update error * Lint
This commit is contained in:
parent
e4ef6b91d6
commit
3fd61d8f45
88 changed files with 207 additions and 255 deletions
|
@ -8,12 +8,10 @@ from homeassistant.components.rflink import (
|
|||
CONF_RECONNECT_INTERVAL, SERVICE_SEND_COMMAND)
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_STOP_COVER)
|
||||
from tests.common import assert_setup_component
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def mock_rflink(hass, config, domain, monkeypatch, failures=None,
|
||||
platform_count=1):
|
||||
def mock_rflink(hass, config, domain, monkeypatch, failures=None):
|
||||
"""Create mock Rflink asyncio protocol, test component setup."""
|
||||
transport, protocol = (Mock(), Mock())
|
||||
|
||||
|
@ -47,9 +45,7 @@ def mock_rflink(hass, config, domain, monkeypatch, failures=None,
|
|||
'rflink.protocol.create_rflink_connection',
|
||||
mock_create)
|
||||
|
||||
# verify instantiation of component with given config
|
||||
with assert_setup_component(platform_count, domain):
|
||||
yield from async_setup_component(hass, domain, config)
|
||||
yield from async_setup_component(hass, domain, config)
|
||||
|
||||
# hook into mock config for injecting events
|
||||
event_callback = mock_create.call_args_list[0][1]['event_callback']
|
||||
|
@ -164,7 +160,7 @@ def test_send_command(hass, monkeypatch):
|
|||
|
||||
# setup mocking rflink module
|
||||
_, _, protocol, _ = yield from mock_rflink(
|
||||
hass, config, domain, monkeypatch, platform_count=5)
|
||||
hass, config, domain, monkeypatch)
|
||||
|
||||
hass.async_add_job(
|
||||
hass.services.async_call(domain, SERVICE_SEND_COMMAND,
|
||||
|
@ -188,7 +184,7 @@ def test_send_command_invalid_arguments(hass, monkeypatch):
|
|||
|
||||
# setup mocking rflink module
|
||||
_, _, protocol, _ = yield from mock_rflink(
|
||||
hass, config, domain, monkeypatch, platform_count=5)
|
||||
hass, config, domain, monkeypatch)
|
||||
|
||||
# one argument missing
|
||||
hass.async_add_job(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue