Move config code to separate module + test cover it

This commit is contained in:
Paulus Schoutsen committed 2015-04-26 10:05:01 -07:00
1 parent bc3af134f9
commit ad016de653
7 files changed
+395 -82

No files matched your search

+6 -1
View File
@@ -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