예제 #1
0
def test_remove(application: Application, mocker: MockerFixture) -> None:
    """
    must remove package
    """
    executor_mock = mocker.patch(
        "ahriman.core.repository.executor.Executor.process_remove")
    finalize_mock = mocker.patch(
        "ahriman.application.application.Application._finalize")

    application.remove([])
    executor_mock.assert_called_once()
    finalize_mock.assert_called_once()
예제 #2
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
         configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     client = Application(architecture, configuration).repository.reporter
     callback: Callable[[str], None] = lambda p: client.remove(
         p) if args.remove else client.update(p, args.status)
     if args.package:
         # update packages statuses
         for package in args.package:
             callback(package)
     else:
         # update service status
         client.update_self(args.status)