mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-12-16 12:13:42 +00:00
improve VCS packages checks
* Unlike older version, currently service will always try to pull AUR package to check version. Previously if no-vcs flag is set, it would ignore VCS packages completelly * Introduce build.vcs_allowed_age option. If set, it will skip version calculation if package age (now - build_date) is less than this value
This commit is contained in:
@ -11,8 +11,8 @@ from typing import Any
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from ahriman.core.exceptions import BuildError, OptionError, UnsafeRunError
|
||||
from ahriman.core.util import check_output, check_user, exception_response_text, filter_json, full_version, \
|
||||
enum_values, package_like, pretty_datetime, pretty_size, safe_filename, walk
|
||||
from ahriman.core.util import check_output, check_user, enum_values, exception_response_text, filter_json, \
|
||||
full_version, package_like, pretty_datetime, pretty_size, safe_filename, utcnow, walk
|
||||
from ahriman.models.package import Package
|
||||
from ahriman.models.package_source import PackageSource
|
||||
from ahriman.models.repository_paths import RepositoryPaths
|
||||
@ -322,6 +322,15 @@ def test_safe_filename() -> None:
|
||||
assert safe_filename("tolua++-1.0.93-4-x86_64.pkg.tar.zst") == "tolua---1.0.93-4-x86_64.pkg.tar.zst"
|
||||
|
||||
|
||||
def test_utcnow() -> None:
|
||||
"""
|
||||
must generate correct timestamp
|
||||
"""
|
||||
ts1 = utcnow()
|
||||
ts2 = utcnow()
|
||||
assert 1 > (ts2 - ts1).total_seconds() > 0
|
||||
|
||||
|
||||
def test_walk(resource_path_root: Path) -> None:
|
||||
"""
|
||||
must traverse directory recursively
|
||||
|
||||
Reference in New Issue
Block a user