mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
do not ask confirmation for local sign. Also add argparser test
This commit is contained in:
parent
fb29c715f0
commit
91793cfbfc
@ -116,7 +116,7 @@ class GPG:
|
|||||||
"""
|
"""
|
||||||
key_body = self.download_key(server, key)
|
key_body = self.download_key(server, key)
|
||||||
GPG._check_output("gpg", "--import", input_data=key_body, exception=None, logger=self.logger)
|
GPG._check_output("gpg", "--import", input_data=key_body, exception=None, logger=self.logger)
|
||||||
GPG._check_output("gpg", "--lsign-key", key, exception=None, logger=self.logger)
|
GPG._check_output("gpg", "--quick-lsign-key", key, exception=None, logger=self.logger)
|
||||||
|
|
||||||
def process(self, path: Path, key: str) -> List[Path]:
|
def process(self, path: Path, key: str) -> List[Path]:
|
||||||
"""
|
"""
|
||||||
|
@ -71,6 +71,15 @@ def test_subparsers_config(parser: argparse.ArgumentParser) -> None:
|
|||||||
assert args.unsafe
|
assert args.unsafe
|
||||||
|
|
||||||
|
|
||||||
|
def test_subparsers_key_import(parser: argparse.ArgumentParser) -> None:
|
||||||
|
"""
|
||||||
|
key-import command must imply lock and no_report
|
||||||
|
"""
|
||||||
|
args = parser.parse_args(["-a", "x86_64", "key-import", "key"])
|
||||||
|
assert args.lock is None
|
||||||
|
assert args.no_report
|
||||||
|
|
||||||
|
|
||||||
def test_subparsers_search(parser: argparse.ArgumentParser) -> None:
|
def test_subparsers_search(parser: argparse.ArgumentParser) -> None:
|
||||||
"""
|
"""
|
||||||
search command must imply lock, no_report and unsafe
|
search command must imply lock, no_report and unsafe
|
||||||
|
@ -92,7 +92,7 @@ def test_import_key(gpg: GPG, mocker: MockerFixture) -> None:
|
|||||||
gpg.import_key("keys.gnupg.net", "0xE989490C")
|
gpg.import_key("keys.gnupg.net", "0xE989490C")
|
||||||
check_output_mock.assert_has_calls([
|
check_output_mock.assert_has_calls([
|
||||||
mock.call("gpg", "--import", input_data="key", exception=None, logger=pytest.helpers.anyvar(int)),
|
mock.call("gpg", "--import", input_data="key", exception=None, logger=pytest.helpers.anyvar(int)),
|
||||||
mock.call("gpg", "--lsign-key", "0xE989490C", exception=None, logger=pytest.helpers.anyvar(int))
|
mock.call("gpg", "--quick-lsign-key", "0xE989490C", exception=None, logger=pytest.helpers.anyvar(int))
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user