From bf983222d8e6bbefb5d59d0c68a099ed1915740d Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 11 Sep 2026 14:10:55 +0000 Subject: [PATCH] test suite: whitespace --- test/cmdtest_d/autosign.py | 8 ++++++-- test/cmdtest_d/input.py | 13 +++++++++++-- test/cmdtest_d/main.py | 8 ++++---- test/cmdtest_d/misc.py | 5 +++-- test/cmdtest_d/ref.py | 4 +++- test/cmdtest_d/ref_3seed.py | 4 ++-- test/cmdtest_d/ref_altcoin.py | 6 +++++- test/daemontest_d/msg.py | 7 ++++++- test/include/common.py | 3 +-- 9 files changed, 41 insertions(+), 17 deletions(-) diff --git a/test/cmdtest_d/autosign.py b/test/cmdtest_d/autosign.py index 534375ab..755c7070 100755 --- a/test/cmdtest_d/autosign.py +++ b/test/cmdtest_d/autosign.py @@ -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: diff --git a/test/cmdtest_d/input.py b/test/cmdtest_d/input.py index 806a84ac..36ec12ca 100755 --- a/test/cmdtest_d/input.py +++ b/test/cmdtest_d/input.py @@ -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' diff --git a/test/cmdtest_d/main.py b/test/cmdtest_d/main.py index 5f360d1b..01ee42a8 100755 --- a/test/cmdtest_d/main.py +++ b/test/cmdtest_d/main.py @@ -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 diff --git a/test/cmdtest_d/misc.py b/test/cmdtest_d/misc.py index 76f00caf..38be92b1 100755 --- a/test/cmdtest_d/misc.py +++ b/test/cmdtest_d/misc.py @@ -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 diff --git a/test/cmdtest_d/ref.py b/test/cmdtest_d/ref.py index 077b6ebb..dd9de35b 100755 --- a/test/cmdtest_d/ref.py +++ b/test/cmdtest_d/ref.py @@ -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: diff --git a/test/cmdtest_d/ref_3seed.py b/test/cmdtest_d/ref_3seed.py index ead943f2..291339e0 100755 --- a/test/cmdtest_d/ref_3seed.py +++ b/test/cmdtest_d/ref_3seed.py @@ -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 diff --git a/test/cmdtest_d/ref_altcoin.py b/test/cmdtest_d/ref_altcoin.py index 124e47a7..3316ef39 100755 --- a/test/cmdtest_d/ref_altcoin.py +++ b/test/cmdtest_d/ref_altcoin.py @@ -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 diff --git a/test/daemontest_d/msg.py b/test/daemontest_d/msg.py index 46f54fbe..31b80da5 100755 --- a/test/daemontest_d/msg.py +++ b/test/daemontest_d/msg.py @@ -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): diff --git a/test/include/common.py b/test/include/common.py index 1915235a..ba2df7bd 100755 --- a/test/include/common.py +++ b/test/include/common.py @@ -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):