mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-10-31 05:43:41 +00:00 
			
		
		
		
	do not ask confirmation for local sign. Also add argparser test
This commit is contained in:
		| @ -116,7 +116,7 @@ class GPG: | ||||
|         """ | ||||
|         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", "--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]: | ||||
|         """ | ||||
|  | ||||
| @ -71,6 +71,15 @@ def test_subparsers_config(parser: argparse.ArgumentParser) -> None: | ||||
|     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: | ||||
|     """ | ||||
|     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") | ||||
|     check_output_mock.assert_has_calls([ | ||||
|         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)) | ||||
|     ]) | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user