Add first pass at Z-Wave light tests (#6483)
* Add first pass at Z-Wave light tests * Remove unused SIGNAL_VALUE * Lint * Update test_init.py
This commit is contained in:
1 parent
ddc260b628
commit
855756cb2a
5 files changed
+155
-21
No files matched your search
@@ -1,28 +1,11 @@
|
||||
"""Tests for the Z-Wave init."""
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_openzwave():
|
||||
"""Mock out Open Z-Wave."""
|
||||
libopenzwave = MagicMock()
|
||||
libopenzwave.__file__ = 'test'
|
||||
with patch.dict('sys.modules', {
|
||||
'libopenzwave': libopenzwave,
|
||||
'openzwave.option': MagicMock(),
|
||||
'openzwave.network': MagicMock(),
|
||||
'openzwave.group': MagicMock(),
|
||||
}):
|
||||
yield
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_valid_device_config(hass):
|
||||
def test_valid_device_config(hass, mock_openzwave):
|
||||
"""Test valid device config."""
|
||||
device_config = {
|
||||
'light.kitchen': {
|
||||
@@ -38,7 +21,7 @@ def test_valid_device_config(hass):
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_invalid_device_config(hass):
|
||||
def test_invalid_device_config(hass, mock_openzwave):
|
||||
"""Test invalid device config."""
|
||||
device_config = {
|
||||
'light.kitchen': {
|
||||
|
||||
Reference in new issue
Block a user