mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-24 19:29:57 +00:00
remove own implementations of getlist and getpath method in order to use
converters feature
This commit is contained in:
@ -3,6 +3,7 @@ import pytest
|
||||
from pathlib import Path
|
||||
from pytest_mock import MockerFixture
|
||||
from unittest import mock
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from ahriman.core.report.report import Report
|
||||
from ahriman.core.repository.executor import Executor
|
||||
@ -137,14 +138,13 @@ def test_process_report(executor: Executor, package_ahriman: Package, mocker: Mo
|
||||
report_mock.assert_called_once()
|
||||
|
||||
|
||||
def test_process_report_auto(executor: Executor, mocker: MockerFixture) -> None:
|
||||
def test_process_report_auto(executor: Executor) -> None:
|
||||
"""
|
||||
must process report in auto mode if no targets supplied
|
||||
"""
|
||||
configuration_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
|
||||
|
||||
configuration_mock = executor.configuration = MagicMock()
|
||||
executor.process_report(None, [])
|
||||
configuration_getlist_mock.assert_called_once()
|
||||
configuration_mock.getlist.assert_called_once()
|
||||
|
||||
|
||||
def test_process_upload(executor: Executor, mocker: MockerFixture) -> None:
|
||||
@ -158,14 +158,13 @@ def test_process_upload(executor: Executor, mocker: MockerFixture) -> None:
|
||||
upload_mock.assert_called_once()
|
||||
|
||||
|
||||
def test_process_upload_auto(executor: Executor, mocker: MockerFixture) -> None:
|
||||
def test_process_upload_auto(executor: Executor) -> None:
|
||||
"""
|
||||
must process sync in auto mode if no targets supplied
|
||||
"""
|
||||
configuration_getlist_mock = mocker.patch("ahriman.core.configuration.Configuration.getlist")
|
||||
|
||||
configuration_mock = executor.configuration = MagicMock()
|
||||
executor.process_sync(None, [])
|
||||
configuration_getlist_mock.assert_called_once()
|
||||
configuration_mock.getlist.assert_called_once()
|
||||
|
||||
|
||||
def test_process_update(executor: Executor, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
|
@ -104,7 +104,7 @@ def test_getlist_empty(configuration: Configuration) -> None:
|
||||
"""
|
||||
must return list of string correctly for non-existing option
|
||||
"""
|
||||
assert configuration.getlist("build", "test_list") == []
|
||||
assert configuration.getlist("build", "test_list", fallback=[]) == []
|
||||
configuration.set_option("build", "test_list", "")
|
||||
assert configuration.getlist("build", "test_list") == []
|
||||
|
||||
|
Reference in New Issue
Block a user