Make --trusted default when running spack gpg list (#5678)

* Make --trusted default when running spack gpg list

Currently running `spack gpg list` with no arguments returns nothing. You must supply either the `--trusted` or the `--signing` options. The idea here is to return some initial data to the user when the command is run. The alternative is to return an error, telling the user to select one of the two options.

* Add an extra test case for the empty list command

Fixes the issue with code coverage
This commit is contained in:
David Hows 2017-10-13 05:14:48 +11:00 committed by Todd Gamblin
parent 65b38764ae
commit 0dad5b3ee5
2 changed files with 2 additions and 1 deletions

View file

@ -82,7 +82,7 @@ def setup_parser(subparser):
list = subparsers.add_parser('list') list = subparsers.add_parser('list')
list.add_argument('--trusted', action='store_true', list.add_argument('--trusted', action='store_true',
help='list trusted keys') default=True, help='list trusted keys')
list.add_argument('--signing', action='store_true', list.add_argument('--signing', action='store_true',
help='list keys which may be used for signing') help='list keys which may be used for signing')
list.set_defaults(func=gpg_list) list.set_defaults(func=gpg_list)

View file

@ -98,6 +98,7 @@ def test_gpg(gpg, tmpdir, testing_gpg_directory):
# List the keys. # List the keys.
# TODO: Test the output here. # TODO: Test the output here.
gpg('list')
gpg('list', '--trusted') gpg('list', '--trusted')
gpg('list', '--signing') gpg('list', '--signing')