test suite: whitespace

This commit is contained in:
The MMGen Project 2026-09-11 14:10:55 +00:00
commit bf983222d8
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
9 changed files with 41 additions and 17 deletions

View file

@ -617,7 +617,9 @@ class CmdTestAutosignThreaded(CmdTestAutosignBase):
def _wait_loop_start(self, opts=[], add_opts=[]):
t = self.spawn(
'mmgen-autosign',
(opts or self.opts) + add_opts + ['--full-summary', 'wait'],
(opts or self.opts)
+ add_opts
+ ['--full-summary', 'wait'],
direct_exec = True,
no_passthru_opts = True,
spawn_env_override = self.spawn_env | {'EXEC_WRAPPER_DO_RUNTIME_MSG': ''})
@ -673,7 +675,9 @@ class CmdTestAutosignThreaded(CmdTestAutosignBase):
self.insert_device()
self.do_mount()
src = Path(self.asi.txauto_dir)
t = self.spawn('mmgen-tool', ['txview'] + [str(fn) for fn in sorted(src.iterdir())])
t = self.spawn(
'mmgen-tool',
['txview'] + [str(fn) for fn in sorted(src.iterdir())])
text = t.read()
if expect_str:
if reverse:

View file

@ -118,7 +118,13 @@ class CmdTestInput(CmdTestBase):
def get_seed_from_stdin(self):
self.spawn(msg_only=True)
from subprocess import run
cmd = ['python3', 'cmds/mmgen-walletconv', '--skip-cfg-file', '--in-fmt=words', '--out-fmt=words', '--outdir=test/trash']
cmd = [
'python3',
'cmds/mmgen-walletconv',
'--skip-cfg-file',
'--in-fmt=words',
'--out-fmt=words',
'--outdir=test/trash']
mn = sample_mn['mmgen']['mn']
run_env = dict(os.environ)
run_env['MMGEN_TEST_SUITE'] = ''
@ -126,7 +132,10 @@ class CmdTestInput(CmdTestBase):
cp = run(cmd, input=mn.encode(), capture_output=True, env=run_env)
imsg(cp.stderr.decode().strip())
res = get_data_from_file(self.cfg, 'test/trash/A773B05C[128].mmwords', silent=True).strip()
res = get_data_from_file(
self.cfg,
'test/trash/A773B05C[128].mmwords',
silent = True).strip()
assert res == mn, f'{res} != {mn}'
return 'ok' if b'written to file' in cp.stderr else 'error'

View file

@ -39,8 +39,8 @@ from ..include.common import (
getrandnum,
getrandnum_range,
getrandhex,
strip_ansi_escapes
)
strip_ansi_escapes)
from .include.common import (
pwfile,
hincog_fn,
@ -51,8 +51,8 @@ from .include.common import (
hincog_bytes,
hincog_seedlen,
incog_id_fn,
non_mmgen_fn
)
non_mmgen_fn)
from .base import CmdTestBase
from .shared import CmdTestShared

View file

@ -89,8 +89,9 @@ class CmdTestMisc(CmdTestBase):
if self.cfg.no_altcoin:
return 'skip'
tx = 'test/ref/bitcoin_cash/895108-BCH[2.65913].rawtx'
t = self.spawn('mmgen-tool', ['--coin=bch', f'--cashaddr={view_pref}', 'txview', tx, f'terse={terse}'])
#t = self.spawn('mmgen-tool', ['--coin=bch', '--longhelp'])
t = self.spawn(
'mmgen-tool',
['--coin=bch', f'--cashaddr={view_pref}', 'txview', tx, f'terse={terse}'])
t.expect(expect)
return t

View file

@ -354,7 +354,9 @@ class CmdTestRefTX(CmdTestRef):
def _ref_txfile_chk(self, cfgfile_lines=[], *, idx, ver=None, allowed=False):
expect_str = 'legacy-format' if ver is None else f'with version {ver}'
write_to_cfgfile(cfgfile_lines)
t = self.spawn('mmgen-tool', ['txview', self._get_txfile(idx)])
t = self.spawn(
'mmgen-tool',
['txview', self._get_txfile(idx)])
if allowed:
assert not expect_str in t.read()
else:

View file

@ -33,8 +33,8 @@ from .include.common import (
ref_wallet_brainpass,
ref_wallet_incog_offset,
ref_dir,
ok_msg
)
ok_msg)
from .base import CmdTestBase
from .shared import CmdTestShared
from .wallet import CmdTestWalletConv

View file

@ -21,7 +21,11 @@ test.cmdtest_d.ref_altcoin: Altcoin reference file tests for the cmdtest.py test
"""
from .include.common import pwfile, dfl_wpasswd, ref_dir, dfl_words_file, dfl_addr_idx_list
from ..include.common import joinpath, start_test_daemons, stop_test_daemons, cmp_or_die
from ..include.common import (
joinpath,
start_test_daemons,
stop_test_daemons,
cmp_or_die)
from .ref import CmdTestRef, CmdTestRefTX
from .base import CmdTestBase

View file

@ -11,7 +11,12 @@ from mmgen.protocol import CoinProtocol
from mmgen.msg import NewMsg, UnsignedMsg, SignedMsg, SignedOnlineMsg, ExportedMsgSigs
from mmgen.addr import MMGenID
from ..include.common import cfg, silence, end_silence, restart_test_daemons, stop_test_daemons
from ..include.common import (
cfg,
silence,
end_silence,
restart_test_daemons,
stop_test_daemons)
def get_obj(coin, network, msghash_type):

View file

@ -184,8 +184,7 @@ def clean(cfgs, tmpdir_ids=None, extra_dirs=[]):
if cleaned := list(clean_func()):
iqmsg(green('Cleaned director{} {}'.format(
suf(cleaned, 'ies'),
fmt_list(cleaned, fmt=list_fmt)
)))
fmt_list(cleaned, fmt=list_fmt))))
for d in extra_dirs:
if (os.path.exists(d) or os.path.islink(d)) and not os.path.isdir(d):