* Add first pass at Z-Wave light tests * Remove unused SIGNAL_VALUE * Lint * Update test_init.py
36 lines
840 B
Python
36 lines
840 B
Python
"""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."""
|
|
device_config = {
|
|
'light.kitchen': {
|
|
'ignored': 'true'
|
|
}
|
|
}
|
|
result = yield from async_setup_component(hass, 'zwave', {
|
|
'zwave': {
|
|
'device_config': device_config
|
|
}})
|
|
|
|
assert result
|
|
|
|
|
|
@asyncio.coroutine
|
|
def test_invalid_device_config(hass, mock_openzwave):
|
|
"""Test invalid device config."""
|
|
device_config = {
|
|
'light.kitchen': {
|
|
'some_ignored': 'true'
|
|
}
|
|
}
|
|
result = yield from async_setup_component(hass, 'zwave', {
|
|
'zwave': {
|
|
'device_config': device_config
|
|
}})
|
|
|
|
assert not result
|