2016-08-10 06:54:34 +00:00
|
|
|
"""Test script init."""
|
2021-01-01 21:31:56 +00:00
|
|
|
from unittest.mock import patch
|
2016-08-10 06:54:34 +00:00
|
|
|
|
2021-01-01 21:31:56 +00:00
|
|
|
import homeassistant.scripts as scripts
|
2020-05-03 18:27:19 +00:00
|
|
|
|
2016-08-10 06:54:34 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
@patch("homeassistant.scripts.get_default_config_dir", return_value="/default")
|
2023-02-20 10:42:56 +00:00
|
|
|
def test_config_per_platform(mock_def) -> None:
|
2019-04-30 16:20:38 +00:00
|
|
|
"""Test config per platform method."""
|
2019-07-31 19:25:30 +00:00
|
|
|
assert scripts.get_default_config_dir() == "/default"
|
|
|
|
assert scripts.extract_config_dir() == "/default"
|
|
|
|
assert scripts.extract_config_dir([""]) == "/default"
|
|
|
|
assert scripts.extract_config_dir(["-c", "/arg"]) == "/arg"
|
|
|
|
assert scripts.extract_config_dir(["--config", "/a"]) == "/a"
|