mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-22 10:19:57 +00:00
add ability to use ahriman pacman database instead of system one (#71)
By default this feature is enabled. On the first run it will copy (if exists) databases from filesystem to local cache (one per each architecture). Later it will use this cache for all alpm operations. In order to update this cache, some commands (mainly package building) provide `-y`/`--refresh` option which has same semantics as pacman -Sy does. Note however that due to extending `Pacman` class some methods were renamed in order to be more descriptive: * `Pacman.all_packages` -> `Pacman.packages` * `Pacman.get` -> `Pacman.package_get` This commit also adds multilib repository to the default docker image which was missed.
This commit is contained in:
@ -75,6 +75,18 @@ def test_subparsers_daemon(parser: argparse.ArgumentParser) -> None:
|
||||
assert args.package == []
|
||||
|
||||
|
||||
def test_subparsers_daemon_option_refresh(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
daemon command must count refresh options
|
||||
"""
|
||||
args = parser.parse_args(["daemon"])
|
||||
assert args.refresh == 0
|
||||
args = parser.parse_args(["daemon", "-y"])
|
||||
assert args.refresh == 1
|
||||
args = parser.parse_args(["daemon", "-yy"])
|
||||
assert args.refresh == 2
|
||||
|
||||
|
||||
def test_subparsers_daemon_option_interval(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
daemon command must convert interval option to int instance
|
||||
@ -155,6 +167,18 @@ def test_subparsers_package_add_architecture(parser: argparse.ArgumentParser) ->
|
||||
assert args.architecture == ["x86_64"]
|
||||
|
||||
|
||||
def test_subparsers_package_add_option_refresh(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
package-add command must count refresh options
|
||||
"""
|
||||
args = parser.parse_args(["package-add", "ahriman"])
|
||||
assert args.refresh == 0
|
||||
args = parser.parse_args(["package-add", "ahriman", "-y"])
|
||||
assert args.refresh == 1
|
||||
args = parser.parse_args(["package-add", "ahriman", "-yy"])
|
||||
assert args.refresh == 2
|
||||
|
||||
|
||||
def test_subparsers_package_remove_architecture(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
package-remove command must correctly parse architecture list
|
||||
@ -345,6 +369,18 @@ def test_subparsers_repo_check_architecture(parser: argparse.ArgumentParser) ->
|
||||
assert args.architecture == ["x86_64"]
|
||||
|
||||
|
||||
def test_subparsers_repo_check_option_refresh(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
repo-check command must count refresh options
|
||||
"""
|
||||
args = parser.parse_args(["repo-check"])
|
||||
assert args.refresh == 0
|
||||
args = parser.parse_args(["repo-check", "-y"])
|
||||
assert args.refresh == 1
|
||||
args = parser.parse_args(["repo-check", "-yy"])
|
||||
assert args.refresh == 2
|
||||
|
||||
|
||||
def test_subparsers_repo_clean(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
repo-clean command must imply quiet and unsafe
|
||||
@ -540,6 +576,18 @@ def test_subparsers_repo_update_architecture(parser: argparse.ArgumentParser) ->
|
||||
assert args.architecture == ["x86_64"]
|
||||
|
||||
|
||||
def test_subparsers_repo_update_option_refresh(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
repo-update command must count refresh options
|
||||
"""
|
||||
args = parser.parse_args(["repo-update"])
|
||||
assert args.refresh == 0
|
||||
args = parser.parse_args(["repo-update", "-y"])
|
||||
assert args.refresh == 1
|
||||
args = parser.parse_args(["repo-update", "-yy"])
|
||||
assert args.refresh == 2
|
||||
|
||||
|
||||
def test_subparsers_shell(parser: argparse.ArgumentParser) -> None:
|
||||
"""
|
||||
shell command must imply lock and no-report
|
||||
|
Reference in New Issue
Block a user