Added test for undocumented preflight.

This commit is contained in:
Salvador E. Tropea 2021-02-04 11:27:57 -03:00
parent e413cf0214
commit dd28c63089
3 changed files with 23 additions and 1 deletions

View File

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

View File

@ -0,0 +1,12 @@
from kibot.macros import macros, pre_class # noqa: F401
from .log import get_logger
logger = get_logger(__name__)
@pre_class
class Pre_Test(BasePreFlight): # noqa: F821
def __init__(self, name, value):
super().__init__(name, value)
self._enabled = value
self._pcb_related = True

View File

@ -382,6 +382,16 @@ def test_help_output_plugin_2(test_dir, monkeypatch):
ctx.clean_up()
def test_help_output_plugin_3(test_dir, monkeypatch):
ctx = context.TestContext(test_dir, 'test_help_output_plugin_3', '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-preflights'], no_verbose=True, no_out_dir=True, no_yaml_file=True, no_board_file=True)
assert ctx.search_out('- pre_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)