mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
This feature also introduces the followiing changes * aur-search command now works as expected with multiterms * printer classes for managing of data print * --sort-by argument for aur-search subcommand instead of using package name * --quiet argument now has also --no-quite option * if --quite is supplied, the log level will be set to warn instead of critical to be able to see error messages * pretty_datetime function now also supports datetime objects * BuildStatus is now pure dataclass
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
from unittest.mock import MagicMock
|
|
|
|
from ahriman.application.formatters.package_printer import PackagePrinter
|
|
from ahriman.application.formatters.printer import Printer
|
|
|
|
|
|
def test_print(package_ahriman_printer: PackagePrinter) -> None:
|
|
"""
|
|
must print content
|
|
"""
|
|
log_mock = MagicMock()
|
|
package_ahriman_printer.print(verbose=False, log_fn=log_mock)
|
|
log_mock.assert_called()
|
|
|
|
|
|
def test_print_empty() -> None:
|
|
"""
|
|
must not print empty object
|
|
"""
|
|
log_mock = MagicMock()
|
|
Printer().print(verbose=True, log_fn=log_mock)
|
|
log_mock.assert_not_called()
|
|
|
|
|
|
def test_print_verbose(package_ahriman_printer: PackagePrinter) -> None:
|
|
"""
|
|
must print content with increased verbosity
|
|
"""
|
|
log_mock = MagicMock()
|
|
package_ahriman_printer.print(verbose=True, log_fn=log_mock)
|
|
log_mock.assert_called()
|
|
|
|
|
|
def test_properties() -> None:
|
|
"""
|
|
must return empty properties list
|
|
"""
|
|
assert Printer().properties() == []
|
|
|
|
|
|
def test_title() -> None:
|
|
"""
|
|
must return empty title
|
|
"""
|
|
assert Printer().title() is None
|