license message bugfix and test

This commit is contained in:
The MMGen Project 2023-04-01 12:25:28 +00:00
commit 2e68cc095b
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 22 additions and 4 deletions

View file

@ -20,10 +20,10 @@
contrib.license: Copyright notice and text of GPLv3
"""
from ..globalvars import g
from ..globalvars import gc
warning = f"""
{g.proj_name} Copyright (C) {g.Cdates} by {g.author} {g.email}. This
{gc.proj_name} Copyright (C) {gc.Cdates} by {gc.author} {gc.email}. This
program comes with ABSOLUTELY NO WARRANTY. This is free software, and
you are welcome to redistribute it under certain conditions.
"""

View file

@ -1 +1 @@
March 2023
April 2023

View file

@ -1 +1 @@
13.3.dev42
13.3.dev43

View file

@ -98,6 +98,7 @@ class TestSuiteHelp(TestSuiteBase):
cmd_group = (
('usage', (1,'usage message',[])),
('version', (1,'version message',[])),
('license', (1,'license message',[])),
('helpscreens', (1,'help screens', [])),
('longhelpscreens', (1,'help screens (--longhelp)',[])),
('show_hash_presets', (1,'info screen (--show-hash-presets)',[])),
@ -118,6 +119,23 @@ class TestSuiteHelp(TestSuiteBase):
t.expect('MMGEN-TOOL version')
return t
def license(self):
lsave = os.getenv('MMGEN_NO_LICENSE')
os.environ['MMGEN_NO_LICENSE'] = ''
t = self.spawn(f'mmgen-walletconv',['--stdout','--in-fmt=hex','--out-fmt=hex'])
t.expect('to continue: ', 'w')
t.expect('TERMS AND CONDITIONS') # start of GPL text
if cfg.pexpect_spawn:
t.send('G')
t.expect('return for a fee.') # end of GPL text
if cfg.pexpect_spawn:
t.send('q')
t.expect('to continue: ', 'c')
t.expect('data: ','beadcafe'*4 + '\n')
t.expect('to confirm: ', 'YES\n')
os.environ['MMGEN_NO_LICENSE'] = lsave
return t
def spawn_chk_expect(self,*args,**kwargs):
expect = kwargs.pop('expect')
t = self.spawn(*args,**kwargs)