From 5682e7f74ec99c980fe10e3dc650e2b2853a5609 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 1 Nov 2022 14:36:45 +0000 Subject: [PATCH] test suite: minor cleanups --- test/misc/input_func.py | 3 ++- test/test.py | 2 +- test/test_py_d/ts_input.py | 5 ++--- test/test_py_d/ts_wallet.py | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/misc/input_func.py b/test/misc/input_func.py index 4db17979..38657ba7 100755 --- a/test/misc/input_func.py +++ b/test/misc/input_func.py @@ -19,7 +19,8 @@ elif cmd_args[0] in ('get_char','line_input'): from mmgen.ui import line_input from ast import literal_eval func_args = literal_eval(cmd_args[1]) - Msg(f'\n g.hold_protect_disable: {g.hold_protect_disable}') + Msg(f'\n term: {get_char.__self__.__name__}') + Msg(f' g.hold_protect_disable: {g.hold_protect_disable}') Msg(' {name}( {args} )'.format( name = cmd_args[0], args = ', '.join(f'{k}={v!r}' for k,v in func_args.items()) diff --git a/test/test.py b/test/test.py index 9b7c3f73..262feed4 100755 --- a/test/test.py +++ b/test/test.py @@ -194,7 +194,7 @@ parsed_opts = opts.init(opts_data,return_parsed=True) usr_args = parsed_opts.cmd_args if opt.daemon_id and opt.daemon_id in g.blacklist_daemons.split(): - die(0,f'test.py: daemon {opt.daemon_id!r} blacklisted, exiting') + die(1,f'test.py: daemon {opt.daemon_id!r} blacklisted, exiting') network_id = g.coin.lower() + ('_tn' if opt.testnet else '') diff --git a/test/test_py_d/ts_input.py b/test/test_py_d/ts_input.py index 226c4a2d..fa6d8d72 100755 --- a/test/test_py_d/ts_input.py +++ b/test/test_py_d/ts_input.py @@ -226,7 +226,7 @@ class TestSuiteInput(TestSuiteBase): cmd_dir='.', pexpect_spawn=term ) imsg('Parameters:') - imsg(' terminal: {}'.format(term)) + imsg(' pexpect_spawn: {}'.format(term)) imsg(' sending: {!r}'.format(text)) imsg(' expecting: {!r}'.format(expect)) imsg('\nFunction args:') @@ -314,9 +314,8 @@ class TestSuiteInput(TestSuiteBase): assert ret == pw, f'Password mismatch! {ret} != {pw}' return t - # TODO: has this been fixed? winskip_msg = """ - getpass() doesn't work with pexpect.popen_spawn on MSYS2! + pexpect_spawn not supported on Windows platform Perform the following test by hand with non-ASCII password abc-α or another password in your native alphabet: diff --git a/test/test_py_d/ts_wallet.py b/test/test_py_d/ts_wallet.py index 8bb006fb..ddd70b1c 100755 --- a/test/test_py_d/ts_wallet.py +++ b/test/test_py_d/ts_wallet.py @@ -153,7 +153,8 @@ class TestSuiteWalletConv(TestSuiteBase,TestSuiteShared): def do_run(cmd): from subprocess import run,PIPE,DEVNULL return run(cmd,stdout=PIPE,stderr=DEVNULL,check=True) - if self.skip_for_win(): return 'skip' + if self.skip_for_win(): + return 'skip' imsg('Creating block device image file') ic_img = joinpath(self.tmpdir,'hincog_blkdev_img') do_run(['dd','if=/dev/zero','of='+ic_img,'bs=1K','count=1'])