mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-23 18:59:56 +00:00
exactly one called with instead of last call check
This commit is contained in:
@ -70,7 +70,7 @@ def test_patch_set_list(application: Application, mocker: MockerFixture) -> None
|
||||
print_mock = mocker.patch("ahriman.application.handlers.patch.Patch._print")
|
||||
|
||||
Patch.patch_set_list(application, "ahriman")
|
||||
glob_mock.assert_called_with("*.patch")
|
||||
glob_mock.assert_called_once_with("*.patch")
|
||||
print_mock.assert_called()
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ def test_patch_set_create(application: Application, package_ahriman: Package, mo
|
||||
patch_dir = application.repository.paths.patches_for(package_ahriman.base)
|
||||
|
||||
Patch.patch_set_create(application, Path("path"), ["*.patch"])
|
||||
create_mock.assert_called_with(Path("path"), patch_dir / "00-main.patch", "*.patch")
|
||||
create_mock.assert_called_once_with(Path("path"), patch_dir / "00-main.patch", "*.patch")
|
||||
|
||||
|
||||
def test_patch_set_create_clear(application: Application, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
@ -120,4 +120,4 @@ def test_patch_set_remove(application: Application, package_ahriman: Package, mo
|
||||
patch_dir = application.repository.paths.patches_for(package_ahriman.base)
|
||||
|
||||
Patch.patch_set_remove(application, package_ahriman.base)
|
||||
remove_mock.assert_called_with(patch_dir, ignore_errors=True)
|
||||
remove_mock.assert_called_once_with(patch_dir, ignore_errors=True)
|
||||
|
@ -45,7 +45,7 @@ def test_run_filter(args: argparse.Namespace, configuration: Configuration,
|
||||
application_mock = mocker.patch("ahriman.application.application.Application.update")
|
||||
|
||||
Rebuild.run(args, "x86_64", configuration, True)
|
||||
application_mock.assert_called_with([package_ahriman])
|
||||
application_mock.assert_called_once_with([package_ahriman])
|
||||
|
||||
|
||||
def test_run_without_filter(args: argparse.Namespace, configuration: Configuration,
|
||||
@ -61,4 +61,4 @@ def test_run_without_filter(args: argparse.Namespace, configuration: Configurati
|
||||
application_mock = mocker.patch("ahriman.application.application.Application.update")
|
||||
|
||||
Rebuild.run(args, "x86_64", configuration, True)
|
||||
application_mock.assert_called_with([package_ahriman, package_python_schedule])
|
||||
application_mock.assert_called_once_with([package_ahriman, package_python_schedule])
|
||||
|
@ -47,7 +47,7 @@ def test_run_dry_run(args: argparse.Namespace, configuration: Configuration, pac
|
||||
RemoveUnknown.run(args, "x86_64", configuration, True)
|
||||
application_mock.assert_called_once()
|
||||
remove_mock.assert_not_called()
|
||||
log_fn_mock.assert_called_with(package_ahriman)
|
||||
log_fn_mock.assert_called_once_with(package_ahriman)
|
||||
|
||||
|
||||
def test_log_fn(package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
|
@ -39,7 +39,7 @@ def test_run_multiple_search(args: argparse.Namespace, configuration: Configurat
|
||||
search_mock = mocker.patch("aur.search")
|
||||
|
||||
Search.run(args, "x86_64", configuration, True)
|
||||
search_mock.assert_called_with(" ".join(args.search))
|
||||
search_mock.assert_called_once_with(" ".join(args.search))
|
||||
|
||||
|
||||
def test_log_fn(args: argparse.Namespace, configuration: Configuration, aur_package_ahriman: aur.Package,
|
||||
|
@ -134,7 +134,7 @@ def test_create_sudo_configuration(args: argparse.Namespace, mocker: MockerFixtu
|
||||
write_text_mock = mocker.patch("pathlib.Path.write_text")
|
||||
|
||||
Setup.create_sudo_configuration(args.build_command, "x86_64")
|
||||
chmod_text_mock.assert_called_with(0o400)
|
||||
chmod_text_mock.assert_called_once_with(0o400)
|
||||
write_text_mock.assert_called_once()
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ def test_run_with_package_filter(args: argparse.Namespace, configuration: Config
|
||||
return_value=[(package_ahriman, BuildStatus(BuildStatusEnum.Success))])
|
||||
|
||||
Status.run(args, "x86_64", configuration, True)
|
||||
packages_mock.assert_called_with(package_ahriman.base)
|
||||
packages_mock.assert_called_once_with(package_ahriman.base)
|
||||
|
||||
|
||||
def test_run_by_status(args: argparse.Namespace, configuration: Configuration, package_ahriman: Package,
|
||||
|
Reference in New Issue
Block a user