Browse Source

CmdTestBase: new `is_helper` attribute

The MMGen Project 5 months ago
parent
commit
26ff0081cc

+ 1 - 0
test/cmdtest_d/base.py

@@ -39,6 +39,7 @@ class CmdTestBase:
 	platform_skip = ()
 	tmpdir_nums = []
 	test_name = None
+	is_helper = False
 
 	def __init__(self, cfg, trunner, cfgs, spawn):
 		if hasattr(self, 'name'): # init will be called multiple times for classes with multiple inheritance

+ 1 - 0
test/cmdtest_d/ethbump.py

@@ -436,6 +436,7 @@ class CmdTestEthBump(CmdTestEthBumpMethods, CmdTestEthSwapMethods, CmdTestSwapMe
 class CmdTestEthBumpLTC(CmdTestSwapMethods, CmdTestRegtest):
 	network = ('ltc',)
 	tmpdir_nums = [43]
+	is_helper = True
 	cmd_group_in = CmdTestRegtest.cmd_group_in + (
 		('setup',           'LTC regtest setup'),
 		('walletconv_bob',  'LTC wallet generation'),

+ 1 - 0
test/cmdtest_d/ethswap.py

@@ -321,6 +321,7 @@ class CmdTestEthSwapEth(CmdTestEthSwapMethods, CmdTestSwapMethods, CmdTestEthdev
 	tmpdir_nums = [48]
 	fund_amt = '123.456'
 	token_fund_amt = 1000
+	is_helper = True
 
 	bals = lambda self, k: {
 		'swap1': [('98831F3A:E:1', '123.456')],

+ 9 - 8
test/cmdtest_d/include/group_mgr.py

@@ -170,14 +170,15 @@ class CmdGroupMgr:
 			yield green(f'{desc} COMMAND GROUPS AND SUBGROUPS:')
 			yield ''
 			for name, cls in ginfo:
-				yield '  {} - {}'.format(
-					yellow(name.ljust(13)),
-					(cls.__doc__.strip() if cls.__doc__ else cls.__name__))
-				if 'cmd_subgroups' in cls.__dict__:
-					subgroups = {k:v for k, v in cls.cmd_subgroups.items() if not k.startswith('_')}
-					max_w = max(len(k) for k in subgroups)
-					for k, v in subgroups.items():
-						yield '    + {} · {}'.format(cyan(k.ljust(max_w+1)), v[0])
+				if not cls.is_helper:
+					yield '  {} - {}'.format(
+						yellow(name.ljust(13)),
+						(cls.__doc__.strip() if cls.__doc__ else cls.__name__))
+					if 'cmd_subgroups' in cls.__dict__:
+						subgroups = {k:v for k, v in cls.cmd_subgroups.items() if not k.startswith('_')}
+						max_w = max(len(k) for k in subgroups)
+						for k, v in subgroups.items():
+							yield '    + {} · {}'.format(cyan(k.ljust(max_w+1)), v[0])
 
 		from mmgen.ui import do_pager
 		do_pager('\n'.join(gen_output()))

+ 1 - 0
test/cmdtest_d/runeswap.py

@@ -87,6 +87,7 @@ class CmdTestRuneSwapRune(CmdTestSwapMethods, CmdTestRune):
 	networks = ('rune',)
 	tmpdir_nums = [58]
 	input_sels_prompt = 'to spend from: '
+	is_helper = True
 
 	cmd_group_in = CmdTestRune.cmd_group_in + (
 		# rune_swap: