hass-core/tests/components/zwave/test_init.py

37 lines
840 B
Python
Raw Normal View History

2017-02-13 08:54:11 -08:00
"""Tests for the Z-Wave init."""
import asyncio
from homeassistant.bootstrap import async_setup_component
@asyncio.coroutine
def test_valid_device_config(hass, mock_openzwave):
"""Test valid device config."""
2017-02-13 08:54:11 -08:00
device_config = {
'light.kitchen': {
'ignored': 'true'
}
}
result = yield from async_setup_component(hass, 'zwave', {
2017-02-13 08:54:11 -08:00
'zwave': {
'device_config': device_config
}})
assert result
2017-02-13 08:54:11 -08:00
@asyncio.coroutine
def test_invalid_device_config(hass, mock_openzwave):
"""Test invalid device config."""
device_config = {
'light.kitchen': {
'some_ignored': 'true'
}
2017-02-13 08:54:11 -08:00
}
result = yield from async_setup_component(hass, 'zwave', {
'zwave': {
'device_config': device_config
}})
2017-02-13 08:54:11 -08:00
assert not result