mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 07:17:17 +00:00
* add external process spawner and update test cases * pass no_report to handlers * provide service api endpoints * do not spawn process for single architecture run * pass no report to handlers * make _call method of handlers public and also simplify process spawn * move update under add * implement actions from web page * clear logging & improve l&f
29 lines
813 B
Python
29 lines
813 B
Python
import argparse
|
|
|
|
from pytest_mock import MockerFixture
|
|
|
|
from ahriman.application.handlers import Sync
|
|
from ahriman.core.configuration import Configuration
|
|
|
|
|
|
def _default_args(args: argparse.Namespace) -> argparse.Namespace:
|
|
"""
|
|
default arguments for these test cases
|
|
:param args: command line arguments fixture
|
|
:return: generated arguments for these test cases
|
|
"""
|
|
args.target = []
|
|
return args
|
|
|
|
|
|
def test_run(args: argparse.Namespace, configuration: Configuration, mocker: MockerFixture) -> None:
|
|
"""
|
|
must run command
|
|
"""
|
|
args = _default_args(args)
|
|
mocker.patch("pathlib.Path.mkdir")
|
|
application_mock = mocker.patch("ahriman.application.application.Application.sync")
|
|
|
|
Sync.run(args, "x86_64", configuration, True)
|
|
application_mock.assert_called_once()
|