CmdTestBase: new is_helper attribute

This commit is contained in:
The MMGen Project 2025-06-16 14:35:30 +00:00
commit 26ff0081cc
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
5 changed files with 13 additions and 8 deletions

View file

@ -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

View file

@ -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'),

View file

@ -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')],

View file

@ -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()))

View file

@ -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: