mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-22 18:29:56 +00:00
feat: add autorefresh button to the main page (#149)
* also add configuration options and change behaviour accordingly
This commit is contained in:
@ -133,6 +133,14 @@ def test_dump_architecture_specific(configuration: Configuration) -> None:
|
||||
assert dump["build"]["archbuild_flags"] == "hello flag"
|
||||
|
||||
|
||||
def test_getintlist(configuration: Configuration) -> None:
|
||||
"""
|
||||
must extract list of integers
|
||||
"""
|
||||
configuration.set_option("build", "test_int_list", "1 42 3")
|
||||
assert configuration.getintlist("build", "test_int_list") == [1, 42, 3]
|
||||
|
||||
|
||||
def test_getlist(configuration: Configuration) -> None:
|
||||
"""
|
||||
must return list of string correctly
|
||||
|
@ -10,8 +10,8 @@ from unittest.mock import call as MockCall
|
||||
|
||||
from ahriman.core.exceptions import BuildError, CalledProcessError, OptionError, UnsafeRunError
|
||||
from ahriman.core.utils import check_output, check_user, dataclass_view, enum_values, extract_user, filter_json, \
|
||||
full_version, minmax, package_like, parse_version, partition, pretty_datetime, pretty_size, safe_filename, \
|
||||
srcinfo_property, srcinfo_property_list, trim_package, utcnow, walk
|
||||
full_version, minmax, package_like, parse_version, partition, pretty_datetime, pretty_interval, pretty_size, \
|
||||
safe_filename, srcinfo_property, srcinfo_property_list, trim_package, utcnow, walk
|
||||
from ahriman.models.package import Package
|
||||
from ahriman.models.package_source import PackageSource
|
||||
from ahriman.models.repository_id import RepositoryId
|
||||
@ -341,6 +341,18 @@ def test_pretty_datetime_empty() -> None:
|
||||
assert pretty_datetime(None) == ""
|
||||
|
||||
|
||||
def test_pretty_interval() -> None:
|
||||
"""
|
||||
must generate string from interval
|
||||
"""
|
||||
assert pretty_interval(1) == "1 second"
|
||||
assert pretty_interval(42) == "42 seconds"
|
||||
assert pretty_interval(62) == "1 minute 2 seconds"
|
||||
assert pretty_interval(121) == "2 minutes 1 second"
|
||||
assert pretty_interval(3600) == "1 hour"
|
||||
assert pretty_interval(7242) == "2 hours 42 seconds"
|
||||
|
||||
|
||||
def test_pretty_size_bytes() -> None:
|
||||
"""
|
||||
must generate bytes string for bytes value
|
||||
|
Reference in New Issue
Block a user