Preserve customize glob order. (#6963)

* Preserve customize glob order.

* add tests
This commit is contained in:
Andrey 2017-04-07 08:39:35 +03:00 committed by Paulus Schoutsen
parent 3e66df50c8
commit f96e06a2c2
4 changed files with 24 additions and 2 deletions

View file

@ -1,7 +1,11 @@
"""Tests for the Z-Wave init."""
import asyncio
import unittest
from collections import OrderedDict
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.zwave import (
CONFIG_SCHEMA, CONF_DEVICE_CONFIG_GLOB)
@asyncio.coroutine
@ -34,3 +38,14 @@ def test_invalid_device_config(hass, mock_openzwave):
}})
assert not result
class TestZwave(unittest.TestCase):
"""Test zwave init."""
def test_device_config_glob_is_ordered(self):
"""Test that device_config_glob preserves order."""
conf = CONFIG_SCHEMA(
{'zwave': {CONF_DEVICE_CONFIG_GLOB: OrderedDict()}})
self.assertIsInstance(
conf['zwave'][CONF_DEVICE_CONFIG_GLOB], OrderedDict)