fix includes glob and trim version from dependencies

This commit is contained in:
2021-03-25 03:59:47 +03:00
parent bf8a93d080
commit f3acc01906
7 changed files with 58 additions and 4 deletions

14
tests/ahriman/conftest.py Normal file
View File

@ -0,0 +1,14 @@
import pytest
from typing import Any, Type, TypeVar
T = TypeVar("T")
# https://stackoverflow.com/a/21611963
@pytest.helpers.register
def anyvar(cls: Type[T], strict: bool = False) -> T:
class AnyVar(cls):
def __eq__(self, other: Any) -> bool:
return not strict or isinstance(other, cls)
return AnyVar()

View File

@ -71,6 +71,17 @@ def test_from_json_view_3(package_tpacpi_bat_git: Package) -> None:
assert Package.from_json(package_tpacpi_bat_git.view()) == package_tpacpi_bat_git
def test_dependencies_with_version(mocker: MockerFixture, resource_path_root: Path) -> None:
"""
must load correct list of dependencies with version
"""
srcinfo = (resource_path_root / "models" / "package_yay_srcinfo").read_text()
mocker.patch("pathlib.Path.read_text", return_value=srcinfo)
assert Package.dependencies(Path("path")) == {"git", "go", "pacman"}
def test_actual_version(package_ahriman: Package, repository_paths: RepositoryPaths) -> None:
"""
must return same actual_version as version is

View File

@ -14,4 +14,4 @@ pkgbase = tpacpi-bat-git
source = git+https://github.com/teleshoes/tpacpi-bat.git
b2sums = SKIP
pkgname = tpacpi-bat-git
pkgname = tpacpi-bat-git

View File

@ -0,0 +1,21 @@
pkgbase = yay
pkgdesc = Yet another yogurt. Pacman wrapper and AUR helper written in go.
pkgver = 10.2.0
pkgrel = 1
url = https://github.com/Jguer/yay
arch = i686
arch = pentium4
arch = x86_64
arch = arm
arch = armv7h
arch = armv6h
arch = aarch64
license = GPL3
makedepends = go
depends = pacman>5
depends = git
optdepends = sudo
source = yay-10.2.0.tar.gz::https://github.com/Jguer/yay/archive/v10.2.0.tar.gz
sha256sums = 755d049ec09cc20bdcbb004b12ab4e35ba3bb94a7dce9dfa544d24f87deda8aa
pkgname = yay