Rename of the zwave hass.data constants (#7768)
* Rename of the zwave hass.data constants * Remove zwave since it is already implied
This commit is contained in:
1 parent
3a843e1817
commit
65c3201fa6
9 files changed
+47
-48
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""Test Z-Wave config panel."""
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock
|
||||
from homeassistant.components.zwave import ZWAVE_NETWORK, const
|
||||
from homeassistant.components.zwave import DATA_NETWORK, const
|
||||
from homeassistant.components.zwave.api import (
|
||||
ZWaveNodeGroupView, ZWaveNodeConfigView, ZWaveUserCodeView)
|
||||
from tests.common import mock_http_component_app
|
||||
@@ -14,7 +14,7 @@ def test_get_groups(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeGroupView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=2)
|
||||
node.groups.associations = 'assoc'
|
||||
node.groups.associations_instances = 'inst'
|
||||
@@ -46,7 +46,7 @@ def test_get_groups_nogroups(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeGroupView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=2)
|
||||
|
||||
network.nodes = {2: node}
|
||||
@@ -67,7 +67,7 @@ def test_get_groups_nonode(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeGroupView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
network.nodes = {1: 1, 5: 5}
|
||||
|
||||
client = yield from test_client(app)
|
||||
@@ -86,11 +86,11 @@ def test_get_config(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeConfigView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=2)
|
||||
value = MockValue(
|
||||
index=12,
|
||||
command_class=const.COMMAND_CLASS_CONFIGURATION)
|
||||
index=12,
|
||||
command_class=const.COMMAND_CLASS_CONFIGURATION)
|
||||
value.label = 'label'
|
||||
value.help = 'help'
|
||||
value.type = 'type'
|
||||
@@ -124,7 +124,7 @@ def test_get_config_noconfig_node(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeConfigView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=2)
|
||||
|
||||
network.nodes = {2: node}
|
||||
@@ -146,7 +146,7 @@ def test_get_config_nonode(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveNodeConfigView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
network.nodes = {1: 1, 5: 5}
|
||||
|
||||
client = yield from test_client(app)
|
||||
@@ -165,7 +165,7 @@ def test_get_usercodes_nonode(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveUserCodeView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
network.nodes = {1: 1, 5: 5}
|
||||
|
||||
client = yield from test_client(app)
|
||||
@@ -184,12 +184,12 @@ def test_get_usercodes(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveUserCodeView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=18,
|
||||
command_classes=[const.COMMAND_CLASS_USER_CODE])
|
||||
value = MockValue(
|
||||
index=0,
|
||||
command_class=const.COMMAND_CLASS_USER_CODE)
|
||||
index=0,
|
||||
command_class=const.COMMAND_CLASS_USER_CODE)
|
||||
value.genre = const.GENRE_USER
|
||||
value.label = 'label'
|
||||
value.data = '1234'
|
||||
@@ -215,7 +215,7 @@ def test_get_usercode_nousercode_node(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveUserCodeView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=18)
|
||||
|
||||
network.nodes = {18: node}
|
||||
@@ -237,12 +237,12 @@ def test_get_usercodes_no_genreuser(hass, test_client):
|
||||
app = mock_http_component_app(hass)
|
||||
ZWaveUserCodeView().register(app.router)
|
||||
|
||||
network = hass.data[ZWAVE_NETWORK] = MagicMock()
|
||||
network = hass.data[DATA_NETWORK] = MagicMock()
|
||||
node = MockNode(node_id=18,
|
||||
command_classes=[const.COMMAND_CLASS_USER_CODE])
|
||||
value = MockValue(
|
||||
index=0,
|
||||
command_class=const.COMMAND_CLASS_USER_CODE)
|
||||
index=0,
|
||||
command_class=const.COMMAND_CLASS_USER_CODE)
|
||||
value.genre = const.GENRE_SYSTEM
|
||||
value.label = 'label'
|
||||
value.data = '1234'
|
||||
|
||||
Reference in new issue
Block a user