1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 22:18:40 +00:00

RFC: Create a secrets file and enable HTTP password by default (#9685)

* Create a secret and enable password by default

* Comment out api password secret

* Lint/fix tests
This commit is contained in:
Paulus Schoutsen
2017-10-05 09:10:29 -07:00
committed by GitHub
parent 8db4641455
commit 75f902f57e
4 changed files with 32 additions and 12 deletions

View File

@@ -302,7 +302,7 @@ class TestSecrets(unittest.TestCase):
config_dir = get_test_config_dir()
yaml.clear_secret_cache()
self._yaml_path = os.path.join(config_dir, YAML_CONFIG_FILE)
self._secret_path = os.path.join(config_dir, yaml._SECRET_YAML)
self._secret_path = os.path.join(config_dir, yaml.SECRET_YAML)
self._sub_folder_path = os.path.join(config_dir, 'subFolder')
self._unrelated_path = os.path.join(config_dir, 'unrelated')
@@ -351,7 +351,7 @@ class TestSecrets(unittest.TestCase):
def test_secret_overrides_parent(self):
"""Test loading current directory secret overrides the parent."""
expected = {'api_password': 'override'}
load_yaml(os.path.join(self._sub_folder_path, yaml._SECRET_YAML),
load_yaml(os.path.join(self._sub_folder_path, yaml.SECRET_YAML),
'http_pw: override')
self._yaml = load_yaml(os.path.join(self._sub_folder_path, 'sub.yaml'),
'http:\n'
@@ -365,7 +365,7 @@ class TestSecrets(unittest.TestCase):
def test_secrets_from_unrelated_fails(self):
"""Test loading secrets from unrelated folder fails."""
load_yaml(os.path.join(self._unrelated_path, yaml._SECRET_YAML),
load_yaml(os.path.join(self._unrelated_path, yaml.SECRET_YAML),
'test: failure')
with self.assertRaises(HomeAssistantError):
load_yaml(os.path.join(self._sub_folder_path, 'sub.yaml'),