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:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-02-17 10:29:14 +01:00
1 parent e4ef6b91d6
commit 3fd61d8f45
88 files changed
+207 -255

No files matched your search

+4 -4
View File
@@ -401,12 +401,12 @@ class TestComponentHistory(unittest.TestCase):
filters = history.Filters()
exclude = config[history.DOMAIN].get(history.CONF_EXCLUDE)
if exclude:
filters.excluded_entities = exclude[history.CONF_ENTITIES]
filters.excluded_domains = exclude[history.CONF_DOMAINS]
filters.excluded_entities = exclude.get(history.CONF_ENTITIES, [])
filters.excluded_domains = exclude.get(history.CONF_DOMAINS, [])
include = config[history.DOMAIN].get(history.CONF_INCLUDE)
if include:
filters.included_entities = include[history.CONF_ENTITIES]
filters.included_domains = include[history.CONF_DOMAINS]
filters.included_entities = include.get(history.CONF_ENTITIES, [])
filters.included_domains = include.get(history.CONF_DOMAINS, [])
hist = history.get_significant_states(
self.hass, zero, four, filters=filters)
+4 -8
View File
@@ -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(