mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
migrate to tox
this also requires to move default configuration files to share/ahriman. Thus the following features have been added * default configuration is not stored in /usr/share/ahriman/settings * package installed via PKGBUILD now copies files from /usr * configuration class now fallbacks to default in /usr
This commit is contained in:
@ -131,7 +131,7 @@ def test_configuration_create_with_plain_password(
|
||||
assert generated.check_credentials(service.password, configuration.get("auth", "salt"))
|
||||
|
||||
|
||||
def test_configuration_get_exists(mocker: MockerFixture) -> None:
|
||||
def test_configuration_get(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must load configuration from filesystem
|
||||
"""
|
||||
@ -143,18 +143,6 @@ def test_configuration_get_exists(mocker: MockerFixture) -> None:
|
||||
read_mock.assert_called_once_with(Path("path") / "auth.ini")
|
||||
|
||||
|
||||
def test_configuration_get_not_exists(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must try to load configuration from filesystem
|
||||
"""
|
||||
mocker.patch("pathlib.Path.open")
|
||||
mocker.patch("pathlib.Path.is_file", return_value=False)
|
||||
read_mock = mocker.patch("ahriman.core.configuration.Configuration.read")
|
||||
|
||||
assert User.configuration_get(Path("path"))
|
||||
read_mock.assert_called_once_with(Path("path") / "auth.ini")
|
||||
|
||||
|
||||
def test_configuration_write(configuration: Configuration, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must write configuration
|
||||
|
@ -14,6 +14,7 @@ def test_from_path(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must load configuration
|
||||
"""
|
||||
mocker.patch("pathlib.Path.is_file", return_value=True)
|
||||
read_mock = mocker.patch("ahriman.core.configuration.Configuration.read")
|
||||
load_includes_mock = mocker.patch("ahriman.core.configuration.Configuration.load_includes")
|
||||
load_logging_mock = mocker.patch("ahriman.core.configuration.Configuration.load_logging")
|
||||
@ -26,6 +27,19 @@ def test_from_path(mocker: MockerFixture) -> None:
|
||||
load_logging_mock.assert_called_once_with(True)
|
||||
|
||||
|
||||
def test_from_path_file_missing(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must load configuration based on package files
|
||||
"""
|
||||
mocker.patch("pathlib.Path.is_file", return_value=False)
|
||||
mocker.patch("ahriman.core.configuration.Configuration.load_includes")
|
||||
mocker.patch("ahriman.core.configuration.Configuration.load_logging")
|
||||
read_mock = mocker.patch("ahriman.core.configuration.Configuration.read")
|
||||
|
||||
configuration = Configuration.from_path(Path("path"), "x86_64", True)
|
||||
read_mock.assert_called_once_with(configuration.SYSTEM_CONFIGURATION_PATH)
|
||||
|
||||
|
||||
def test_dump(configuration: Configuration) -> None:
|
||||
"""
|
||||
dump must not be empty
|
||||
|
@ -1 +1 @@
|
||||
../../../package/share/ahriman
|
||||
../../../package/share/ahriman/templates
|
Reference in New Issue
Block a user