Bugfixes random (#2270)
* Fix Z-Wave autoheal network * Make config_per_platform handle bad config better
This commit is contained in:
1 parent
b60806583c
commit
c9756c40e2
3 files changed
+33
-13
No files matched your search
@@ -1,5 +1,6 @@
|
||||
"""Test component helpers."""
|
||||
# pylint: disable=protected-access,too-many-public-methods
|
||||
from collections import OrderedDict
|
||||
import unittest
|
||||
|
||||
from homeassistant import helpers
|
||||
@@ -30,3 +31,19 @@ class TestHelpers(unittest.TestCase):
|
||||
|
||||
self.assertEqual(set(['zone', 'zone Hallo', 'zone 100']),
|
||||
set(helpers.extract_domain_configs(config, 'zone')))
|
||||
|
||||
def test_config_per_platform(self):
|
||||
"""Test config per platform method."""
|
||||
config = OrderedDict([
|
||||
('zone', {'platform': 'hello'}),
|
||||
('zoner', None),
|
||||
('zone Hallo', [1, {'platform': 'hello 2'}]),
|
||||
('zone 100', None),
|
||||
])
|
||||
|
||||
assert [
|
||||
('hello', config['zone']),
|
||||
(None, 1),
|
||||
('hello 2', config['zone Hallo'][1]),
|
||||
(None, None)
|
||||
] == list(helpers.config_per_platform(config, 'zone'))
|
||||
Reference in new issue
Block a user