add_devices -> add_entities (#16171)
* add_devices -> add_entities * Lint * PyLint * Revert external method in scsgate
This commit is contained in:
parent
37fd438717
commit
994b829cb4
839 changed files with 2121 additions and 2008 deletions
|
@ -128,24 +128,24 @@ def test_setup_platform(hass, mock_openzwave):
|
|||
mock_device = MagicMock()
|
||||
hass.data[DATA_NETWORK] = MagicMock()
|
||||
hass.data[zwave.DATA_DEVICES] = {456: mock_device}
|
||||
async_add_devices = MagicMock()
|
||||
async_add_entities = MagicMock()
|
||||
|
||||
result = yield from zwave.async_setup_platform(
|
||||
hass, None, async_add_devices, None)
|
||||
hass, None, async_add_entities, None)
|
||||
assert not result
|
||||
assert not async_add_devices.called
|
||||
assert not async_add_entities.called
|
||||
|
||||
result = yield from zwave.async_setup_platform(
|
||||
hass, None, async_add_devices, {const.DISCOVERY_DEVICE: 123})
|
||||
hass, None, async_add_entities, {const.DISCOVERY_DEVICE: 123})
|
||||
assert not result
|
||||
assert not async_add_devices.called
|
||||
assert not async_add_entities.called
|
||||
|
||||
result = yield from zwave.async_setup_platform(
|
||||
hass, None, async_add_devices, {const.DISCOVERY_DEVICE: 456})
|
||||
hass, None, async_add_entities, {const.DISCOVERY_DEVICE: 456})
|
||||
assert result
|
||||
assert async_add_devices.called
|
||||
assert len(async_add_devices.mock_calls) == 1
|
||||
assert async_add_devices.mock_calls[0][1][0] == [mock_device]
|
||||
assert async_add_entities.called
|
||||
assert len(async_add_entities.mock_calls) == 1
|
||||
assert async_add_entities.mock_calls[0][1][0] == [mock_device]
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue