more verbose variables

This commit is contained in:
2021-03-30 04:59:13 +03:00
parent eb02e1e62b
commit 4ca2348f0d
35 changed files with 196 additions and 192 deletions

View File

@ -11,7 +11,7 @@ from ahriman.models.repository_paths import RepositoryPaths
def _default_args(args: argparse.Namespace) -> argparse.Namespace:
args.build_command = "ahriman"
args.from_config = "/usr/share/devtools/pacman-extra.conf"
args.from_configuration = "/usr/share/devtools/pacman-extra.conf"
args.no_multilib = False
args.packager = "John Doe <john@doe.com>"
args.repository = "aur-clone"
@ -81,8 +81,8 @@ def test_create_devtools_configuration(args: argparse.Namespace, repository_path
add_section_mock = mocker.patch("configparser.RawConfigParser.add_section")
write_mock = mocker.patch("configparser.RawConfigParser.write")
Setup.create_devtools_configuration(args.build_command, "x86_64", Path(args.from_config), args.no_multilib,
args.repository, repository_paths)
Setup.create_devtools_configuration(args.build_command, "x86_64", Path(args.from_configuration),
args.no_multilib, args.repository, repository_paths)
add_section_mock.assert_has_calls([
mock.call("multilib"),
mock.call(args.repository)
@ -101,8 +101,8 @@ def test_create_devtools_configuration_no_multilib(args: argparse.Namespace, rep
add_section_mock = mocker.patch("configparser.RawConfigParser.add_section")
write_mock = mocker.patch("configparser.RawConfigParser.write")
Setup.create_devtools_configuration(args.build_command, "x86_64", Path(args.from_config), True,
args.repository, repository_paths)
Setup.create_devtools_configuration(args.build_command, "x86_64", Path(args.from_configuration),
True, args.repository, repository_paths)
add_section_mock.assert_called_once()
write_mock.assert_called_once()

View File

@ -107,20 +107,20 @@ def test_process_report_auto(executor: Executor, mocker: MockerFixture) -> None:
"""
must process report in auto mode if no targets supplied
"""
config_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
configuration_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
executor.process_report(None)
config_getlist_mock.assert_called_once()
configuration_getlist_mock.assert_called_once()
def test_process_sync_auto(executor: Executor, mocker: MockerFixture) -> None:
"""
must process sync in auto mode if no targets supplied
"""
config_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
configuration_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
executor.process_sync(None)
config_getlist_mock.assert_called_once()
configuration_getlist_mock.assert_called_once()
def test_process_update(executor: Executor, package_ahriman: Package, mocker: MockerFixture) -> None:

View File

@ -36,10 +36,10 @@ def test_run(application: web.Application, mocker: MockerFixture) -> None:
"""
host = "localhost"
port = 8080
application["config"].set("web", "host", host)
application["config"].set("web", "port", str(port))
run_app_mock = mocker.patch("aiohttp.web.run_app")
application["configuration"].set("web", "host", host)
application["configuration"].set("web", "port", str(port))
run_application_mock = mocker.patch("aiohttp.web.run_app")
run_server(application)
run_app_mock.assert_called_with(application, host=host, port=port,
handle_signals=False, access_log=pytest.helpers.anyvar(int))
run_application_mock.assert_called_with(application, host=host, port=port,
handle_signals=False, access_log=pytest.helpers.anyvar(int))