Rename ha_test folder to tests
This commit is contained in:
1 parent
e0b424c88f
commit
d4cad0b267
20 files changed
+20
-21
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
custom_components.light.test
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Provides a mock switch platform.
|
||||
|
||||
Call init before using it in your tests to ensure clean test data.
|
||||
"""
|
||||
from homeassistant.const import STATE_ON, STATE_OFF
|
||||
from tests.helpers import MockToggleDevice
|
||||
|
||||
|
||||
DEVICES = []
|
||||
|
||||
|
||||
def init(empty=False):
|
||||
""" (re-)initalizes the platform with devices. """
|
||||
global DEVICES
|
||||
|
||||
DEVICES = [] if empty else [
|
||||
MockToggleDevice('Ceiling', STATE_ON),
|
||||
MockToggleDevice('Ceiling', STATE_OFF),
|
||||
MockToggleDevice(None, STATE_OFF)
|
||||
]
|
||||
|
||||
|
||||
def get_lights(hass, config):
|
||||
""" Returns mock devices. """
|
||||
return DEVICES
|
||||
Reference in new issue
Block a user