Added test for undocumented filter.

This commit is contained in:
Salvador E. Tropea 2021-02-04 11:33:52 -03:00
parent dd28c63089
commit fa7dde3008
3 changed files with 25 additions and 1 deletions

View File

@ -329,7 +329,7 @@ def print_filters_help():
for n, o in OrderedDict(sorted(fils.items())).items():
help = o.__doc__
if help is None:
help = 'Undocumented' # pragma: no cover (Internal)
help = 'Undocumented'
print('- {}: {}.'.format(n, help.strip()))
print_output_options(n, o, 2)

View File

@ -0,0 +1,14 @@
from kibot.macros import macros, document, filter_class # noqa: F401
from . import log
logger = log.get_logger(__name__)
@filter_class
class Filter_Test(BaseFilter): # noqa: F821
def __init__(self):
super().__init__()
with document:
self.foo = ':'
self.bar = False
""" Rename fields matching the variant to the value of the component """

View File

@ -392,6 +392,16 @@ def test_help_output_plugin_3(test_dir, monkeypatch):
ctx.clean_up()
def test_help_output_plugin_4(test_dir, monkeypatch):
ctx = context.TestContext(test_dir, 'test_help_output_plugin_4', '3Rs', 'pre_and_position', POS_DIR)
with monkeypatch.context() as m:
m.setenv("HOME", os.path.join(ctx.get_board_dir(), '../..'))
logging.debug('HOME='+os.environ['HOME'])
ctx.run(extra=['--help-filters'], no_verbose=True, no_out_dir=True, no_yaml_file=True, no_board_file=True)
assert ctx.search_out('- filter_test: Undocumented')
ctx.clean_up()
def test_help_outputs(test_dir):
ctx = context.TestContext(test_dir, 'HelpOutputs', '3Rs', 'pre_and_position', POS_DIR)
ctx.run(extra=['--help-outputs'], no_verbose=True, no_out_dir=True, no_yaml_file=True, no_board_file=True)