test suite: minor cleanups

This commit is contained in:
The MMGen Project 2022-11-01 14:36:45 +00:00
commit 5682e7f74e
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 7 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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