Rename config.get_config_path to config.path
This commit is contained in:
1 parent
9b643d57f0
commit
7a7f486cb2
11 files changed
+24
-21
No files matched your search
@@ -32,7 +32,7 @@ class TestComponentsDeviceTracker(unittest.TestCase):
|
||||
self.hass = get_test_home_assistant()
|
||||
loader.prepare(self.hass)
|
||||
|
||||
self.known_dev_path = self.hass.get_config_path(
|
||||
self.known_dev_path = self.hass.config.path(
|
||||
device_tracker.KNOWN_DEVICES_FILE)
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
|
||||
@@ -29,7 +29,7 @@ class TestLight(unittest.TestCase):
|
||||
""" Stop down stuff we started. """
|
||||
self.hass.stop()
|
||||
|
||||
user_light_file = self.hass.get_config_path(light.LIGHT_PROFILES_FILE)
|
||||
user_light_file = self.hass.config.path(light.LIGHT_PROFILES_FILE)
|
||||
|
||||
if os.path.isfile(user_light_file):
|
||||
os.remove(user_light_file)
|
||||
@@ -218,7 +218,7 @@ class TestLight(unittest.TestCase):
|
||||
platform = loader.get_component('light.test')
|
||||
platform.init()
|
||||
|
||||
user_light_file = self.hass.get_config_path(light.LIGHT_PROFILES_FILE)
|
||||
user_light_file = self.hass.config.path(light.LIGHT_PROFILES_FILE)
|
||||
|
||||
# Setup a wrong light file
|
||||
with open(user_light_file, 'w') as user_file:
|
||||
@@ -234,7 +234,7 @@ class TestLight(unittest.TestCase):
|
||||
platform = loader.get_component('light.test')
|
||||
platform.init()
|
||||
|
||||
user_light_file = self.hass.get_config_path(light.LIGHT_PROFILES_FILE)
|
||||
user_light_file = self.hass.config.path(light.LIGHT_PROFILES_FILE)
|
||||
|
||||
with open(user_light_file, 'w') as user_file:
|
||||
user_file.write('id,x,y,brightness\n')
|
||||
|
||||
+2
-2
@@ -35,10 +35,10 @@ class TestHomeAssistant(unittest.TestCase):
|
||||
def test_get_config_path(self):
|
||||
""" Test get_config_path method. """
|
||||
self.assertEqual(os.path.join(os.getcwd(), "config"),
|
||||
self.hass.config_dir)
|
||||
self.hass.config.config_dir)
|
||||
|
||||
self.assertEqual(os.path.join(os.getcwd(), "config", "test.conf"),
|
||||
self.hass.get_config_path("test.conf"))
|
||||
self.hass.config.path("test.conf"))
|
||||
|
||||
def test_block_till_stoped(self):
|
||||
""" Test if we can block till stop service is called. """
|
||||
|
||||
Reference in new issue
Block a user