Browse Source

test suite: minor cleanups

The MMGen Project 2 years ago
parent
commit
5682e7f74e
4 changed files with 7 additions and 6 deletions
  1. 2 1
      test/misc/input_func.py
  2. 1 1
      test/test.py
  3. 2 3
      test/test_py_d/ts_input.py
  4. 2 1
      test/test_py_d/ts_wallet.py

+ 2 - 1
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())

+ 1 - 1
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 '')
 

+ 2 - 3
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:
 

+ 2 - 1
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'])