dynamic html load (#63)

* dynamic html load
* split by classes
This commit is contained in:
2022-05-20 22:29:36 +03:00
committed by GitHub
parent 5674b7b388
commit 47de715d7d
72 changed files with 720 additions and 706 deletions

View File

@ -34,7 +34,7 @@ def test_run(args: argparse.Namespace, configuration: Configuration, package_ahr
"""
args = _default_args(args)
mocker.patch("ahriman.models.repository_paths.RepositoryPaths.tree_create")
application_mock = mocker.patch("ahriman.core.status.client.Client.get_self")
application_mock = mocker.patch("ahriman.core.status.client.Client.get_internal")
packages_mock = mocker.patch("ahriman.core.status.client.Client.get",
return_value=[(package_ahriman, BuildStatus(BuildStatusEnum.Success)),
(package_python_schedule, BuildStatus(BuildStatusEnum.Failed))])
@ -55,7 +55,7 @@ def test_run_empty_exception(args: argparse.Namespace, configuration: Configurat
args = _default_args(args)
args.exit_code = True
mocker.patch("ahriman.models.repository_paths.RepositoryPaths.tree_create")
mocker.patch("ahriman.core.status.client.Client.get_self")
mocker.patch("ahriman.core.status.client.Client.get_internal")
mocker.patch("ahriman.core.status.client.Client.get", return_value=[])
check_mock = mocker.patch("ahriman.application.handlers.Handler.check_if_empty")

View File

@ -28,7 +28,7 @@ def _default_args(args: argparse.Namespace) -> argparse.Namespace:
args.as_service = False
args.exit_code = False
args.password = "pa55w0rd"
args.role = UserAccess.Read
args.role = UserAccess.Reporter
args.secure = False
return args

View File

@ -519,7 +519,7 @@ def test_subparsers_user_add_option_role(parser: argparse.ArgumentParser) -> Non
"""
args = parser.parse_args(["user-add", "username"])
assert isinstance(args.role, UserAccess)
args = parser.parse_args(["user-add", "username", "--role", "write"])
args = parser.parse_args(["user-add", "username", "--role", "full"])
assert isinstance(args.role, UserAccess)
@ -549,7 +549,7 @@ def test_subparsers_user_list_option_role(parser: argparse.ArgumentParser) -> No
"""
user-list command must convert role option to useraccess instance
"""
args = parser.parse_args(["user-list", "--role", "write"])
args = parser.parse_args(["user-list", "--role", "full"])
assert isinstance(args.role, UserAccess)

View File

@ -8,7 +8,7 @@ from unittest import mock
from ahriman import version
from ahriman.application.lock import Lock
from ahriman.core.exceptions import DuplicateRun, UnsafeRun
from ahriman.models.build_status import BuildStatusEnum
from ahriman.models.build_status import BuildStatus, BuildStatusEnum
from ahriman.models.internal_status import InternalStatus
@ -57,7 +57,7 @@ def test_check_version(lock: Lock, mocker: MockerFixture) -> None:
must check version correctly
"""
mocker.patch("ahriman.core.status.client.Client.get_internal",
return_value=InternalStatus(version=version.__version__))
return_value=InternalStatus(status=BuildStatus(), version=version.__version__))
logging_mock = mocker.patch("logging.Logger.warning")
lock.check_version()
@ -69,7 +69,7 @@ def test_check_version_mismatch(lock: Lock, mocker: MockerFixture) -> None:
must check mismatched version correctly
"""
mocker.patch("ahriman.core.status.client.Client.get_internal",
return_value=InternalStatus(version="version"))
return_value=InternalStatus(status=BuildStatus(), version="version"))
logging_mock = mocker.patch("logging.Logger.warning")
lock.check_version()