mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-31 22:59:55 +00:00
handle packages which have been removed from the repository (#45)
* handle packages which have been removed from the repository * manually remove packages which have been removed from the base
This commit is contained in:
@ -147,6 +147,7 @@ def test_unknown_no_aur(application_repository: Repository, package_ahriman: Pac
|
||||
"""
|
||||
mocker.patch("ahriman.core.repository.repository.Repository.packages", return_value=[package_ahriman])
|
||||
mocker.patch("ahriman.models.package.Package.from_aur", side_effect=Exception())
|
||||
mocker.patch("ahriman.models.package.Package.from_build", return_value=package_ahriman)
|
||||
mocker.patch("pathlib.Path.is_dir", return_value=True)
|
||||
mocker.patch("ahriman.core.build_tools.sources.Sources.has_remotes", return_value=False)
|
||||
|
||||
@ -163,7 +164,7 @@ def test_unknown_no_aur_no_local(application_repository: Repository, package_ahr
|
||||
mocker.patch("pathlib.Path.is_dir", return_value=False)
|
||||
|
||||
packages = application_repository.unknown()
|
||||
assert packages == [package_ahriman]
|
||||
assert packages == list(package_ahriman.packages.keys())
|
||||
|
||||
|
||||
def test_unknown_no_local(application_repository: Repository, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
|
@ -5,6 +5,7 @@ from ahriman.application.formatters.aur_printer import AurPrinter
|
||||
from ahriman.application.formatters.configuration_printer import ConfigurationPrinter
|
||||
from ahriman.application.formatters.package_printer import PackagePrinter
|
||||
from ahriman.application.formatters.status_printer import StatusPrinter
|
||||
from ahriman.application.formatters.string_printer import StringPrinter
|
||||
from ahriman.application.formatters.update_printer import UpdatePrinter
|
||||
from ahriman.models.build_status import BuildStatus
|
||||
from ahriman.models.package import Package
|
||||
@ -48,6 +49,15 @@ def status_printer() -> StatusPrinter:
|
||||
return StatusPrinter(BuildStatus())
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def string_printer() -> StringPrinter:
|
||||
"""
|
||||
fixture for any string printer
|
||||
:return: any string printer test instance
|
||||
"""
|
||||
return StringPrinter("hello, world")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def update_printer(package_ahriman: Package) -> UpdatePrinter:
|
||||
"""
|
||||
|
15
tests/ahriman/application/formatters/test_string_printer.py
Normal file
15
tests/ahriman/application/formatters/test_string_printer.py
Normal file
@ -0,0 +1,15 @@
|
||||
from ahriman.application.formatters.string_printer import StringPrinter
|
||||
|
||||
|
||||
def test_properties(string_printer: StringPrinter) -> None:
|
||||
"""
|
||||
must return empty properties list
|
||||
"""
|
||||
assert not string_printer.properties()
|
||||
|
||||
|
||||
def test_title(string_printer: StringPrinter) -> None:
|
||||
"""
|
||||
must return non empty title
|
||||
"""
|
||||
assert string_printer.title() is not None
|
Reference in New Issue
Block a user