Browse Source

license message bugfix and test

The MMGen Project 2 years ago
parent
commit
2e68cc095b
4 changed files with 22 additions and 4 deletions
  1. 2 2
      mmgen/contrib/license.py
  2. 1 1
      mmgen/data/release_date
  3. 1 1
      mmgen/data/version
  4. 18 0
      test/test_py_d/ts_misc.py

+ 2 - 2
mmgen/contrib/license.py

@@ -20,10 +20,10 @@
 contrib.license: Copyright notice and text of GPLv3
 contrib.license: Copyright notice and text of GPLv3
 """
 """
 
 
-from ..globalvars import g
+from ..globalvars import gc
 
 
 warning = f"""
 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
   program comes with ABSOLUTELY NO WARRANTY.  This is free software, and
   you are welcome to redistribute it under certain conditions.
   you are welcome to redistribute it under certain conditions.
 """
 """

+ 1 - 1
mmgen/data/release_date

@@ -1 +1 @@
-March 2023
+April 2023

+ 1 - 1
mmgen/data/version

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

+ 18 - 0
test/test_py_d/ts_misc.py

@@ -98,6 +98,7 @@ class TestSuiteHelp(TestSuiteBase):
 	cmd_group = (
 	cmd_group = (
 		('usage',                 (1,'usage message',[])),
 		('usage',                 (1,'usage message',[])),
 		('version',               (1,'version message',[])),
 		('version',               (1,'version message',[])),
+		('license',               (1,'license message',[])),
 		('helpscreens',           (1,'help screens',             [])),
 		('helpscreens',           (1,'help screens',             [])),
 		('longhelpscreens',       (1,'help screens (--longhelp)',[])),
 		('longhelpscreens',       (1,'help screens (--longhelp)',[])),
 		('show_hash_presets',     (1,'info screen (--show-hash-presets)',[])),
 		('show_hash_presets',     (1,'info screen (--show-hash-presets)',[])),
@@ -118,6 +119,23 @@ class TestSuiteHelp(TestSuiteBase):
 		t.expect('MMGEN-TOOL version')
 		t.expect('MMGEN-TOOL version')
 		return t
 		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):
 	def spawn_chk_expect(self,*args,**kwargs):
 		expect = kwargs.pop('expect')
 		expect = kwargs.pop('expect')
 		t = self.spawn(*args,**kwargs)
 		t = self.spawn(*args,**kwargs)