mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-12 11:49:55 +00:00
docs: improve application help messages
This commit is contained in:
@ -22,7 +22,7 @@ def test_repository_name(configuration: Configuration) -> None:
|
||||
"""
|
||||
must return valid repository name
|
||||
"""
|
||||
assert configuration.repository_name == "aur-clone"
|
||||
assert configuration.repository_name == "aur"
|
||||
|
||||
|
||||
def test_repository_paths(configuration: Configuration, repository_paths: RepositoryPaths) -> None:
|
||||
@ -68,8 +68,8 @@ def test_section_name(configuration: Configuration) -> None:
|
||||
assert configuration.section_name("build") == "build"
|
||||
assert configuration.section_name("build", None) == "build"
|
||||
assert configuration.section_name("build", "x86_64") == "build:x86_64"
|
||||
assert configuration.section_name("build", "aur-clone", "x86_64") == "build:aur-clone:x86_64"
|
||||
assert configuration.section_name("build", "aur-clone", None) == "build:aur-clone"
|
||||
assert configuration.section_name("build", "aur", "x86_64") == "build:aur:x86_64"
|
||||
assert configuration.section_name("build", "aur", None) == "build:aur"
|
||||
assert configuration.section_name("build", None, "x86_64") == "build:x86_64"
|
||||
|
||||
|
||||
@ -379,8 +379,8 @@ def test_override_sections(configuration: Configuration, repository_id: Reposito
|
||||
"""
|
||||
assert configuration.override_sections("build", repository_id) == [
|
||||
"build:x86_64",
|
||||
"build:aur-clone",
|
||||
"build:aur-clone:x86_64",
|
||||
"build:aur",
|
||||
"build:aur:x86_64",
|
||||
]
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ def test_pkgdesc(database: SQLite, gpg: GPG, configuration: Configuration) -> No
|
||||
"""
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgdesc == "aur-clone PGP keyring"
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgdesc == "aur PGP keyring"
|
||||
|
||||
configuration.set_option("keyring", "description", "description")
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgdesc == "description"
|
||||
@ -83,7 +83,7 @@ def test_pkgname(database: SQLite, gpg: GPG, configuration: Configuration) -> No
|
||||
"""
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgname == "aur-clone-keyring"
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgname == "aur-keyring"
|
||||
|
||||
configuration.set_option("keyring", "package", "keyring")
|
||||
assert KeyringGenerator(database, gpg, repository_id, configuration, "keyring").pkgname == "keyring"
|
||||
@ -169,7 +169,7 @@ def test_install(keyring_generator: KeyringGenerator) -> None:
|
||||
"""
|
||||
assert keyring_generator.install() == """post_upgrade() {
|
||||
if usr/bin/pacman-key -l >/dev/null 2>&1; then
|
||||
usr/bin/pacman-key --populate aur-clone
|
||||
usr/bin/pacman-key --populate aur
|
||||
usr/bin/pacman-key --updatedb
|
||||
fi
|
||||
}
|
||||
@ -186,9 +186,9 @@ def test_package(keyring_generator: KeyringGenerator) -> None:
|
||||
must generate package function correctly
|
||||
"""
|
||||
assert keyring_generator.package() == """{
|
||||
install -Dm644 "$srcdir/aur-clone.gpg" "$pkgdir/usr/share/pacman/keyrings/aur-clone.gpg"
|
||||
install -Dm644 "$srcdir/aur-clone-revoked" "$pkgdir/usr/share/pacman/keyrings/aur-clone-revoked"
|
||||
install -Dm644 "$srcdir/aur-clone-trusted" "$pkgdir/usr/share/pacman/keyrings/aur-clone-trusted"
|
||||
install -Dm644 "$srcdir/aur.gpg" "$pkgdir/usr/share/pacman/keyrings/aur.gpg"
|
||||
install -Dm644 "$srcdir/aur-revoked" "$pkgdir/usr/share/pacman/keyrings/aur-revoked"
|
||||
install -Dm644 "$srcdir/aur-trusted" "$pkgdir/usr/share/pacman/keyrings/aur-trusted"
|
||||
}"""
|
||||
|
||||
|
||||
@ -196,6 +196,6 @@ def test_sources(keyring_generator: KeyringGenerator) -> None:
|
||||
"""
|
||||
must return valid sources files list
|
||||
"""
|
||||
assert keyring_generator.sources().get("aur-clone.gpg")
|
||||
assert keyring_generator.sources().get("aur-clone-revoked")
|
||||
assert keyring_generator.sources().get("aur-clone-trusted")
|
||||
assert keyring_generator.sources().get("aur.gpg")
|
||||
assert keyring_generator.sources().get("aur-revoked")
|
||||
assert keyring_generator.sources().get("aur-trusted")
|
||||
|
@ -12,7 +12,7 @@ def test_init_path(configuration: Configuration) -> None:
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").path == \
|
||||
Path("etc") / "pacman.d" / "aur-clone-mirrorlist"
|
||||
Path("etc") / "pacman.d" / "aur-mirrorlist"
|
||||
|
||||
configuration.set_option("mirrorlist", "path", "/etc")
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").path == Path("etc")
|
||||
@ -37,7 +37,7 @@ def test_pkgdesc(configuration: Configuration) -> None:
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").pkgdesc == \
|
||||
"aur-clone mirror list for use by pacman"
|
||||
"aur mirror list for use by pacman"
|
||||
|
||||
configuration.set_option("mirrorlist", "description", "description")
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").pkgdesc == "description"
|
||||
@ -49,7 +49,7 @@ def test_pkgname(configuration: Configuration) -> None:
|
||||
"""
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").pkgname == "aur-clone-mirrorlist"
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").pkgname == "aur-mirrorlist"
|
||||
|
||||
configuration.set_option("mirrorlist", "package", "mirrorlist")
|
||||
assert MirrorlistGenerator(repository_id, configuration, "mirrorlist").pkgname == "mirrorlist"
|
||||
@ -81,7 +81,7 @@ def test_package(mirrorlist_generator: MirrorlistGenerator) -> None:
|
||||
must generate package function correctly
|
||||
"""
|
||||
assert mirrorlist_generator.package() == """{
|
||||
install -Dm644 "$srcdir/mirrorlist" "$pkgdir/etc/pacman.d/aur-clone-mirrorlist"
|
||||
install -Dm644 "$srcdir/mirrorlist" "$pkgdir/etc/pacman.d/aur-mirrorlist"
|
||||
}"""
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ def test_object_path(configuration: Configuration, mocker: MockerFixture) -> Non
|
||||
_, repository_id = configuration.check_loaded()
|
||||
|
||||
# new-style tree
|
||||
assert S3(repository_id, configuration, "customs3").object_path == Path("aur-clone/x86_64")
|
||||
assert S3(repository_id, configuration, "customs3").object_path == Path("aur/x86_64")
|
||||
|
||||
# legacy tree
|
||||
mocker.patch.object(RepositoryPaths, "_suffix", Path("x86_64"))
|
||||
@ -58,12 +58,12 @@ def test_files_remove(s3_remote_objects: list[Any]) -> None:
|
||||
must remove remote objects
|
||||
"""
|
||||
local_files = {
|
||||
Path(item.key): item.e_tag for item in s3_remote_objects if item.key != "aur-clone/x86_64/a"
|
||||
Path(item.key): item.e_tag for item in s3_remote_objects if item.key != "aur/x86_64/a"
|
||||
}
|
||||
remote_objects = {Path(item.key): item for item in s3_remote_objects}
|
||||
|
||||
S3.files_remove(local_files, remote_objects)
|
||||
remote_objects[Path("aur-clone/x86_64/a")].delete.assert_called_once_with()
|
||||
remote_objects[Path("aur/x86_64/a")].delete.assert_called_once_with()
|
||||
|
||||
|
||||
def test_files_upload(s3: S3, s3_remote_objects: list[Any], mocker: MockerFixture) -> None:
|
||||
|
Reference in New Issue
Block a user