From 44ace41c79e5f3da48e393da41b5684e748a2856 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 29 Jul 2021 14:30:22 +0000 Subject: [PATCH] cfg.py: add 'mnemonic_entry_modes' test --- test/misc/cfg.py | 2 ++ test/test_py_d/ts_cfg.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/test/misc/cfg.py b/test/misc/cfg.py index f65fdb94..a1743750 100755 --- a/test/misc/cfg.py +++ b/test/misc/cfg.py @@ -30,3 +30,5 @@ if cmd_args: varname, getattr(proto,varname) )) + elif cmd_args[0] == 'mnemonic_entry_modes': + print( 'mnemonic_entry_modes: {}'.format(g.mnemonic_entry_modes) ) diff --git a/test/test_py_d/ts_cfg.py b/test/test_py_d/ts_cfg.py index 7a07c38d..046a9349 100755 --- a/test/test_py_d/ts_cfg.py +++ b/test/test_py_d/ts_cfg.py @@ -31,6 +31,7 @@ class TestSuiteCfg(TestSuiteBase): ('old_sample_bad_var', (40,'init with old v2 cfg sample file and bad variable in mmgen.cfg', [])), ('coin_specific_vars', (40,'test setting of coin-specific vars', [])), ('chain_names', (40,'test setting of chain names', [])), + ('mnemonic_entry_modes',(40,'test setting of mnemonic entry modes', [])), ) def __init__(self,trunner,cfgs,spawn): @@ -196,6 +197,20 @@ class TestSuiteCfg(TestSuiteBase): t.skip_ok = True return t + def mnemonic_entry_modes(self): + + def run(modes_chk): + t = self.spawn_test(args=['mnemonic_entry_modes']) + modes = t.expect_getend('mnemonic_entry_modes: ') + assert modes_chk == modes, f'{modes_chk} != {modes}' + t.read() + return t + + txt = 'mnemonic_entry_modes mmgen:full bip39:short' + write_to_file(self.path('usr'),txt+'\n') + imsg(yellow(f'Wrote cfg file: "{txt}"')) + return run("{'mmgen': 'full', 'bip39': 'short'}") + def chain_names(self): def run(chk,testnet):