mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-11-04 07:43:42 +00:00 
			
		
		
		
	more properties to be shown in status pages
This commit is contained in:
		@ -58,28 +58,43 @@ def package_python_schedule(
 | 
			
		||||
@pytest.fixture
 | 
			
		||||
def package_description_ahriman() -> PackageDescription:
 | 
			
		||||
    return PackageDescription(
 | 
			
		||||
        architecture="x86_64",
 | 
			
		||||
        archive_size=4200,
 | 
			
		||||
        build_date=42,
 | 
			
		||||
        description="ArcHlinux ReposItory MANager",
 | 
			
		||||
        filename="ahriman-0.12.1-1-any.pkg.tar.zst",
 | 
			
		||||
        installed_size=4200000)
 | 
			
		||||
        groups=[],
 | 
			
		||||
        installed_size=4200000,
 | 
			
		||||
        licenses=["GPL3"],
 | 
			
		||||
        url="https://github.com/arcan1s/ahriman")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture
 | 
			
		||||
def package_description_python_schedule() -> PackageDescription:
 | 
			
		||||
    return PackageDescription(
 | 
			
		||||
        architecture="x86_64",
 | 
			
		||||
        archive_size=4201,
 | 
			
		||||
        build_date=421,
 | 
			
		||||
        description="Python job scheduling for humans.",
 | 
			
		||||
        filename="python-schedule-1.0.0-2-any.pkg.tar.zst",
 | 
			
		||||
        installed_size=4200001)
 | 
			
		||||
        groups=[],
 | 
			
		||||
        installed_size=4200001,
 | 
			
		||||
        licenses=["MIT"],
 | 
			
		||||
        url="https://github.com/dbader/schedule")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture
 | 
			
		||||
def package_description_python2_schedule() -> PackageDescription:
 | 
			
		||||
    return PackageDescription(
 | 
			
		||||
        architecture="x86_64",
 | 
			
		||||
        archive_size=4202,
 | 
			
		||||
        build_date=422,
 | 
			
		||||
        description="Python job scheduling for humans.",
 | 
			
		||||
        filename="python2-schedule-1.0.0-2-any.pkg.tar.zst",
 | 
			
		||||
        installed_size=4200002)
 | 
			
		||||
        groups=[],
 | 
			
		||||
        installed_size=4200002,
 | 
			
		||||
        licenses=["MIT"],
 | 
			
		||||
        url="https://github.com/dbader/schedule")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,17 @@ def test_git_url(package_ahriman: Package) -> None:
 | 
			
		||||
    assert package_ahriman.base in package_ahriman.git_url
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_groups(package_ahriman: Package) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must return list of groups for each package
 | 
			
		||||
    """
 | 
			
		||||
    assert all(
 | 
			
		||||
        all(group in package_ahriman.groups for group in package.groups)
 | 
			
		||||
        for package in package_ahriman.packages.values()
 | 
			
		||||
    )
 | 
			
		||||
    assert sorted(package_ahriman.groups) == package_ahriman.groups
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_is_single_package_false(package_python_schedule: Package) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    python-schedule must not be single package
 | 
			
		||||
@ -42,6 +53,17 @@ def test_is_vcs_true(package_tpacpi_bat_git: Package) -> None:
 | 
			
		||||
    assert package_tpacpi_bat_git.is_vcs
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_licenses(package_ahriman: Package) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must return list of licenses for each package
 | 
			
		||||
    """
 | 
			
		||||
    assert all(
 | 
			
		||||
        all(lic in package_ahriman.licenses for lic in package.licenses)
 | 
			
		||||
        for package in package_ahriman.packages.values()
 | 
			
		||||
    )
 | 
			
		||||
    assert sorted(package_ahriman.licenses) == package_ahriman.licenses
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_web_url(package_ahriman: Package) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must generate valid web url
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user