Minor bugfixes in test scripts

This commit is contained in:
philemon 2015-01-12 22:49:40 +03:00
commit 4e21c323aa
6 changed files with 11 additions and 14 deletions

View file

@ -118,12 +118,8 @@ cmd_args = opt.opts.init(opts_data,add_opts=["b16"])
if opt.show_hash_presets: show_hash_presets()
if opt.from_incog_hex or opt.from_incog_hidden: opt.from_incog = True
if len(cmd_args) == 1 and (
opt.from_mnemonic
or opt.from_brain
or opt.from_seed
or opt.from_incog_hidden
):
if len(cmd_args) == 1 and any([
opt.from_mnemonic,opt.from_brain,opt.from_seed,opt.from_incog_hidden]):
infile,addr_idx_arg = "",cmd_args[0]
elif len(cmd_args) == 2:
infile,addr_idx_arg = cmd_args

View file

@ -112,7 +112,7 @@ def get_seed_for_seed_id(seed_id,infiles,saved_seeds):
while True:
if infiles:
seed = get_seed_retry(infiles.pop(0))
elif opt.from_brain or opt.from_mnemonic or opt.from_seed or opt.from_incog:
elif any([opt.from_brain,opt.from_mnemonic,opt.from_seed,opt.from_incog]):
qmsg("Need seed data for seed ID %s" % seed_id)
seed = get_seed_retry("",seed_id)
msg("User input produced seed ID %s" % make_chksum_8(seed))

View file

@ -151,8 +151,8 @@ if opt.from_brain and not opt.quiet:
g.proj_name, *get_from_brain_opt_params()),
"continue")
if infile or (opt.from_mnemonic or opt.from_brain
or opt.from_seed or opt.from_incog):
if infile or any([
opt.from_mnemonic,opt.from_brain,opt.from_seed,opt.from_incog]):
seed = get_seed_retry(infile)
qmsg("")
else:

View file

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
opts.py: MMGen-specific options processing after general processing by share.Opts
opts.py: MMGen-specific options processing after generic processing by share.Opts
"""
import sys
@ -32,10 +32,10 @@ def usage():
def print_version_info():
Msg("""
{pnu} version {g.version}. Part of the {g.proj_name} suite, a Bitcoin
{progname_uc} version {g.version}. Part of the {g.proj_name} suite, a Bitcoin
cold-storage solution for the command line. Copyright (C) {g.Cdates}
by {g.author} {g.email}
""".format(g=g,pnu=g.prog_name.upper()).strip())
""".format(g=g,progname_uc=g.prog_name.upper()).strip())
def warn_incompatible_opts(incompat_list):
bad = [k for k in opt.__dict__ if opt.__dict__[k] and k in incompat_list]

View file

@ -682,9 +682,11 @@ class MMGenTestSuite(object):
def refwalletgen(self,name):
label = cfg['wallet_label']
args = ["-q","-d",cfg['tmpdir'],"-p1","-r10",
args = ["-d",cfg['tmpdir'],"-p1","-r10",
"-b"+cfg['bw_hashparams'],"-L",label]
t = MMGenExpect(name,"mmgen-walletgen", args)
t.license()
t.expect("Type uppercase 'YES' to confirm: ","YES\n")
t.expect("passphrase: ",cfg['bw_passwd']+"\n")
t.usr_rand(10)
t.passphrase_new("new MMGen wallet",cfg['wpasswd'])

View file

@ -79,7 +79,6 @@ opts_data = {
'usage':"[options] [command]",
'options': """
-h, --help Print this help message
-d, --debug-scripts Turn on debugging output in executed scripts
-l, --list-cmds List and describe the tests and commands in the test suite
-s, --system Test scripts and modules installed on system rather than
those in the repo root