From 3a1ba61fc26b4d195850c78b38d0d0646ba65b34 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 3 Feb 2022 20:40:41 +0000 Subject: [PATCH] test.py input: add 'get_seed_from_stdin' test --- test/test_py_d/ts_input.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test_py_d/ts_input.py b/test/test_py_d/ts_input.py index c5177d25..5eb7ebdd 100755 --- a/test/test_py_d/ts_input.py +++ b/test/test_py_d/ts_input.py @@ -21,6 +21,7 @@ class TestSuiteInput(TestSuiteBase): tmpdir_nums = [] color = True cmd_group = ( + ('get_seed_from_stdin', (1,'reading seed phrase from STDIN', [])), ('get_passphrase_ui', (1,"hash preset, password and label (wallet.py)", [])), ('get_passphrase_cmdline', (1,"hash preset, password and label (wallet.py - from cmdline)", [])), ('get_passphrase_crypto', (1,"hash preset, password and label (crypto.py)", [])), @@ -41,6 +42,18 @@ class TestSuiteInput(TestSuiteBase): ('dieroll_entry_usrrand', (1,"dieroll entry (base6d) with added user entropy", [])), ) + def get_seed_from_stdin(self): + self.spawn('',msg_only=True) + from subprocess import run,PIPE + cmd = ['cmds/mmgen-walletconv','--in-fmt=words','--out-fmt=bip39','--outdir=test/trash'] + mn = sample_mn['mmgen']['mn'] + os.environ['MMGEN_TEST_SUITE'] = '' + cp = run( cmd, input=mn.encode(), stdout=PIPE, stderr=PIPE ) + os.environ['MMGEN_TEST_SUITE'] = '1' + assert b'written to file' in cp.stderr, "test 'get_seed_from_stdin' failed" + imsg(cp.stderr.decode().strip()) + return 'ok' + def get_passphrase_ui(self): t = self.spawn('test/misc/get_passphrase.py',['--usr-randchars=0','seed'],cmd_dir='.')