Move config code to separate module + test cover it
This commit is contained in:
1 parent
bc3af134f9
commit
ad016de653
7 files changed
+395
-82
No files matched your search
+6
-1
@@ -11,10 +11,15 @@ from homeassistant.helpers.entity import ToggleEntity
|
||||
from homeassistant.const import STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME
|
||||
|
||||
|
||||
def get_test_config_dir():
|
||||
""" Returns a path to a test config dir. """
|
||||
return os.path.join(os.path.dirname(__file__), "config")
|
||||
|
||||
|
||||
def get_test_home_assistant():
|
||||
""" Returns a Home Assistant object pointing at test config dir. """
|
||||
hass = ha.HomeAssistant()
|
||||
hass.config.config_dir = os.path.join(os.path.dirname(__file__), "config")
|
||||
hass.config.config_dir = get_test_config_dir()
|
||||
|
||||
return hass
|
||||
|
||||
|
||||
Reference in new issue
Block a user