future/settings: Migrate list to use the new future/settings API

As part of the effort to remove default values scattered around the
code, this change only migrates the list plugin options to use the new
module. This will associate the 'references' to 'list.references' on
configuration file.
Signed-off-by: NBeraldo Leal <bleal@redhat.com>
上级 ec20c1b1
......@@ -20,6 +20,7 @@ from avocado.core import test
from avocado.core import tags
from avocado.core import parser_common_args
from avocado.core.output import LOG_UI
from avocado.core.future.settings import settings
from avocado.core.plugin_interfaces import CLICmd
from avocado.utils import astring
......@@ -122,7 +123,7 @@ class TestLister:
def _list(self):
self._extra_listing()
test_suite = self._get_test_suite(self.args.get('references', []))
test_suite = self._get_test_suite(self.args.get('list.references'))
if self.args.get('filter_by_tags', False):
test_suite = tags.filter_test_tags(
test_suite,
......@@ -157,15 +158,20 @@ class List(CLICmd):
:type parser: :class:`avocado.core.parser.ArgumentParser`
"""
parser = super(List, self).configure(parser)
parser.add_argument('references', type=str, default=[], nargs='*',
help="List of test references (aliases or paths). "
"If empty, avocado will list tests on "
"the configured test source, "
"(see 'avocado config --datadir') Also, "
"if there are other test loader plugins "
"active, tests from those plugins might "
"also show up (behavior may vary among "
"plugins)")
help_msg = ('List of test references (aliases or paths). If empty, '
'Avocado will list tests on the configured test source, '
'(see "avocado config --datadir") Also, if there are '
'other test loader plugins active, tests from those '
'plugins might also show up (behavior may vary among '
'plugins)')
settings.register_option(section='list',
key='references',
default=[],
nargs='*',
key_type=list,
help_msg=help_msg,
parser=parser,
positional_arg=True)
loader.add_loader_options(parser)
parser_common_args.add_tag_filter_args(parser)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册