Browse Source

test suite: relocate some modules, use relative imports

The MMGen Project 5 years ago
parent
commit
de7fba0c19

+ 2 - 2
test/colortest.py

@@ -7,8 +7,8 @@
 colortest.py:  test color handling for the MMGen suite
 colortest.py:  test color handling for the MMGen suite
 """
 """
 
 
-import tests_header
-from test.common import *
+import include.tests_header
+from include.common import *
 from mmgen.color import *
 from mmgen.color import *
 from mmgen.color import _colors
 from mmgen.color import _colors
 init_color()
 init_color()

+ 1 - 1
test/hashfunc.py

@@ -20,7 +20,7 @@ test/hashfunc.py: Test internal implementations of SHA256, SHA512 and Keccak256
 """
 """
 
 
 import sys,os
 import sys,os
-import tests_header
+import include.tests_header
 from mmgen.util import die
 from mmgen.util import die
 
 
 assert len(sys.argv) in (2,3),"Test takes 1 or 2 arguments: test name, plus optional rounds count"
 assert len(sys.argv) in (2,3),"Test takes 1 or 2 arguments: test name, plus optional rounds count"

+ 0 - 0
test/include/__init__.py


+ 0 - 0
test/common.py → test/include/common.py


+ 1 - 1
test/pexpect.py → test/include/pexpect.py

@@ -24,7 +24,7 @@ import sys,os,time
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.util import msg,msg_r,vmsg,vmsg_r,rmsg,red,yellow,green,cyan,die,rdie
 from mmgen.util import msg,msg_r,vmsg,vmsg_r,rmsg,red,yellow,green,cyan,die,rdie
-from test.common import *
+from .common import *
 
 
 try:
 try:
 	import pexpect
 	import pexpect

+ 0 - 0
test/tests_header.py → test/include/tests_header.py


+ 2 - 1
test/misc/utf8_output.py

@@ -13,6 +13,7 @@ text = {
 	'jp': 'Japanese text: {}'.format('必要なのは、信用ではなく暗号化された証明に基づく電子取引システムであり、')
 	'jp': 'Japanese text: {}'.format('必要なのは、信用ではなく暗号化された証明に基づく電子取引システムであり、')
 }
 }
 
 
-assert cmd_args[0] in text,'argument must be one of {}'.format(list(text.keys()))
+if not cmd_args or not cmd_args[0] in text:
+	die(2,'argument must be one of {}'.format(list(text.keys())))
 
 
 msg(text[cmd_args[0]])
 msg(text[cmd_args[0]])

+ 1 - 1
test/objtest_py_d/ot_common.py

@@ -9,7 +9,7 @@ test.objtest_py_d.ot_common: shared data for MMGen data objects tests
 
 
 import os
 import os
 from mmgen.globalvars import g
 from mmgen.globalvars import g
-from ..common import *
+from ..include.common import *
 
 
 r32,r24,r16,r17,r18 = os.urandom(32),os.urandom(24),os.urandom(16),os.urandom(17),os.urandom(18)
 r32,r24,r16,r17,r18 = os.urandom(32),os.urandom(24),os.urandom(16),os.urandom(17),os.urandom(18)
 tw_pfx = g.proto.base_coin.lower()+':'
 tw_pfx = g.proto.base_coin.lower()+':'

+ 2 - 2
test/scrambletest.py

@@ -24,9 +24,9 @@ supported coins + passwords
 import sys,os
 import sys,os
 from subprocess import run,PIPE
 from subprocess import run,PIPE
 
 
-from tests_header import repo_root
+from include.tests_header import repo_root
 from mmgen.common import *
 from mmgen.common import *
-from test.common import *
+from test.include.common import *
 
 
 opts_data = {
 opts_data = {
 	'text': {
 	'text': {

+ 1 - 1
test/start-coin-daemons.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 #!/usr/bin/env python3
 
 
 import sys
 import sys
-from tests_header import repo_root
+from include.tests_header import repo_root
 from mmgen.common import *
 from mmgen.common import *
 from mmgen.daemon import CoinDaemon
 from mmgen.daemon import CoinDaemon
 from mmgen.regtest import MMGenRegtest
 from mmgen.regtest import MMGenRegtest

+ 3 - 3
test/test.py

@@ -71,14 +71,14 @@ def create_shm_dir(data_dir,trash_dir):
 	return shm_dir
 	return shm_dir
 
 
 import sys,os,time
 import sys,os,time
-from tests_header import repo_root
+from include.tests_header import repo_root
 
 
 try: os.unlink(os.path.join(repo_root,'my.err'))
 try: os.unlink(os.path.join(repo_root,'my.err'))
 except: pass
 except: pass
 
 
 from mmgen.common import *
 from mmgen.common import *
 from mmgen.daemon import CoinDaemon
 from mmgen.daemon import CoinDaemon
-from test.common import *
+from test.include.common import *
 from test.test_py_d.common import *
 from test.test_py_d.common import *
 
 
 g.quiet = False # if 'quiet' was set in config file, disable here
 g.quiet = False # if 'quiet' was set in config file, disable here
@@ -666,7 +666,7 @@ class TestSuiteRunner(object):
 			except:
 			except:
 				self.log_fd.write(ascii(cmd_disp)+'\n')
 				self.log_fd.write(ascii(cmd_disp)+'\n')
 
 
-		from test.pexpect import MMGenPexpect
+		from test.include.pexpect import MMGenPexpect
 		return MMGenPexpect(args,no_output=no_output)
 		return MMGenPexpect(args,no_output=no_output)
 
 
 	def end_msg(self):
 	def end_msg(self):

+ 24 - 82
test/test_py_d/common.py

@@ -20,9 +20,9 @@
 common.py: Shared routines and data for the test.py test suite
 common.py: Shared routines and data for the test.py test suite
 """
 """
 
 
-import os,time
+import os
 from mmgen.common import *
 from mmgen.common import *
-from ..common import *
+from ..include.common import *
 
 
 log_file = 'test.py.log'
 log_file = 'test.py.log'
 
 
@@ -113,30 +113,29 @@ def get_file_with_ext(tdir,ext,delete=True,no_dot=False,return_list=False,delete
 	else:
 	else:
 		return flist[0]
 		return flist[0]
 
 
-labels = [
-	"Automotive",
-	"Travel expenses",
-	"Healthcare",
-	tx_label_jp[:40],
-	tx_label_zh[:40],
-	"Alice's allowance",
-	"Bob's bequest",
-	"House purchase",
-	"Real estate fund",
-	"Job 1",
-	"XYZ Corp.",
-	"Eddie's endowment",
-	"Emergency fund",
-	"Real estate fund",
-	"Ian's inheritance",
-	"",
-	"Rainy day",
-	"Fred's funds",
-	"Job 2",
-	"Carl's capital",
-]
-
 def get_label(do_shuffle=False):
 def get_label(do_shuffle=False):
+	labels = [
+		"Automotive",
+		"Travel expenses",
+		"Healthcare",
+		tx_label_jp[:40],
+		tx_label_zh[:40],
+		"Alice's allowance",
+		"Bob's bequest",
+		"House purchase",
+		"Real estate fund",
+		"Job 1",
+		"XYZ Corp.",
+		"Eddie's endowment",
+		"Emergency fund",
+		"Real estate fund",
+		"Ian's inheritance",
+		"",
+		"Rainy day",
+		"Fred's funds",
+		"Job 2",
+		"Carl's capital",
+	]
 	from random import shuffle
 	from random import shuffle
 	global label_iter
 	global label_iter
 	try:
 	try:
@@ -145,60 +144,3 @@ def get_label(do_shuffle=False):
 		if do_shuffle: shuffle(labels)
 		if do_shuffle: shuffle(labels)
 		label_iter = iter(labels)
 		label_iter = iter(labels)
 		return next(label_iter)
 		return next(label_iter)
-
-def stealth_mnemonic_entry(t,mne,mn,entry_mode,pad_entry=False):
-
-	def pad_mnemonic(mn,ss_len):
-		def get_pad_chars(n):
-			ret = ''
-			for i in range(n):
-				m = int.from_bytes(os.urandom(1),'big') % 32
-				ret += r'123579!@#$%^&*()_+-=[]{}"?/,.<>|'[m]
-			return ret
-		ret = []
-		for w in mn:
-			if entry_mode == 'short':
-				w = w[:ss_len]
-				if len(w) < ss_len:
-					npc = 3
-					w = w[0] + get_pad_chars(npc) + w[1:]
-					if pad_entry:
-						w += '%' * (1 + mne.em.pad_max - npc)
-					else:
-						w += '\n'
-				else:
-					w = get_pad_chars(1) + w[0] + get_pad_chars(1) + w[1:]
-			elif len(w) > (3,5)[ss_len==12]:
-				w = w + '\n'
-			else:
-				w = (
-					get_pad_chars(2 if randbool() and entry_mode != 'short' else 0)
-					+ w[0] + get_pad_chars(2) + w[1:]
-					+ get_pad_chars(9) )
-				w = w[:ss_len+1]
-			ret.append(w)
-		return ret
-
-	if entry_mode == 'fixed':
-		mn = ['bkr'] + mn[:5] + ['nfb'] + mn[5:]
-		ssl = mne.uniq_ss_len
-		mn = [w[:ssl] if len(w) >= ssl else (w[0] + 'z\b{}'.format('#'*(ssl-len(w))) + w[1:]) for w in mn]
-	elif entry_mode in ('full','short'):
-		mn = ['fzr'] + mn[:5] + ['grd','grdbxm'] + mn[5:]
-		mn = pad_mnemonic(mn,mne.em.ss_len)
-		mn[10] = '@#$%*##' + mn[10]
-
-	wnum = 1
-	p_ok,p_err = mne.word_prompt
-	for w in mn:
-		ret = t.expect((p_ok.format(wnum),p_err.format(wnum-1)))
-		if ret == 0:
-			wnum += 1
-		for j in range(len(w)):
-			t.send(w[j])
-			time.sleep(0.005)
-
-def user_dieroll_entry(t,data):
-	for s in data:
-		t.expect(r'Enter die roll #.+: ',s,regex=True)
-		time.sleep(0.005)

+ 71 - 0
test/test_py_d/input.py

@@ -0,0 +1,71 @@
+#!/usr/bin/env python3
+#
+# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
+# Copyright (C)2013-2020 The MMGen Project <mmgen@tuta.io>
+#
+# Project source code repository: https://github.com/mmgen/mmgen
+# Licensed according to the terms of GPL Version 3.  See LICENSE for details.
+
+"""
+input.py: Shared input routines for the test.py test suite
+"""
+
+import os,time
+from .common import randbool
+
+def stealth_mnemonic_entry(t,mne,mn,entry_mode,pad_entry=False):
+
+	def pad_mnemonic(mn,ss_len):
+		def get_pad_chars(n):
+			ret = ''
+			for i in range(n):
+				m = int.from_bytes(os.urandom(1),'big') % 32
+				ret += r'123579!@#$%^&*()_+-=[]{}"?/,.<>|'[m]
+			return ret
+		ret = []
+		for w in mn:
+			if entry_mode == 'short':
+				w = w[:ss_len]
+				if len(w) < ss_len:
+					npc = 3
+					w = w[0] + get_pad_chars(npc) + w[1:]
+					if pad_entry:
+						w += '%' * (1 + mne.em.pad_max - npc)
+					else:
+						w += '\n'
+				else:
+					w = get_pad_chars(1) + w[0] + get_pad_chars(1) + w[1:]
+			elif len(w) > (3,5)[ss_len==12]:
+				w = w + '\n'
+			else:
+				w = (
+					get_pad_chars(2 if randbool() and entry_mode != 'short' else 0)
+					+ w[0] + get_pad_chars(2) + w[1:]
+					+ get_pad_chars(9) )
+				w = w[:ss_len+1]
+			ret.append(w)
+		return ret
+
+	if entry_mode == 'fixed':
+		mn = ['bkr'] + mn[:5] + ['nfb'] + mn[5:]
+		ssl = mne.uniq_ss_len
+		mn = [w[:ssl] if len(w) >= ssl else (w[0] + 'z\b{}'.format('#'*(ssl-len(w))) + w[1:]) for w in mn]
+	elif entry_mode in ('full','short'):
+		mn = ['fzr'] + mn[:5] + ['grd','grdbxm'] + mn[5:]
+		mn = pad_mnemonic(mn,mne.em.ss_len)
+		mn[10] = '@#$%*##' + mn[10]
+
+	wnum = 1
+	p_ok,p_err = mne.word_prompt
+	for w in mn:
+		ret = t.expect((p_ok.format(wnum),p_err.format(wnum-1)))
+		if ret == 0:
+			wnum += 1
+		for j in range(len(w)):
+			t.send(w[j])
+			time.sleep(0.005)
+
+def user_dieroll_entry(t,data):
+	for s in data:
+		t.expect(r'Enter die roll #.+: ',s,regex=True)
+		time.sleep(0.005)

+ 6 - 5
test/test_py_d/ts_autosign.py

@@ -25,11 +25,12 @@ from subprocess import run
 
 
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from .ts_base import *
+from .ts_shared import *
+from .input import *
 
 
 class TestSuiteAutosign(TestSuiteBase):
 class TestSuiteAutosign(TestSuiteBase):
 	'autosigning with BTC, BCH, LTC, ETH and ETC'
 	'autosigning with BTC, BCH, LTC, ETH and ETC'
@@ -86,7 +87,7 @@ class TestSuiteAutosign(TestSuiteBase):
 						('mm1','ethereum'),
 						('mm1','ethereum'),
 						('etc','ethereum_classic'))
 						('etc','ethereum_classic'))
 			fdata = [e for e in fdata_in if e[0] in txfiles]
 			fdata = [e for e in fdata_in if e[0] in txfiles]
-			from test.test_py_d.ts_ref import TestSuiteRef
+			from .ts_ref import TestSuiteRef
 			tfns  = [TestSuiteRef.sources['ref_tx_file'][c][1] for c,d in fdata] + \
 			tfns  = [TestSuiteRef.sources['ref_tx_file'][c][1] for c,d in fdata] + \
 					[TestSuiteRef.sources['ref_tx_file'][c][0] for c,d in fdata] + \
 					[TestSuiteRef.sources['ref_tx_file'][c][0] for c,d in fdata] + \
 					['25EFA3[2.34].testnet.rawtx'] # TX with 2 non-MMGen outputs
 					['25EFA3[2.34].testnet.rawtx'] # TX with 2 non-MMGen outputs

+ 2 - 2
test/test_py_d/ts_base.py

@@ -23,8 +23,8 @@ ts_base.py: Base class for the test.py test suite
 import os
 import os
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
 class TestSuiteBase(object):
 class TestSuiteBase(object):
 	'initializer class for the test.py test suite'
 	'initializer class for the test.py test suite'

+ 2 - 2
test/test_py_d/ts_cfg.py

@@ -12,8 +12,8 @@ ts_misc.py: CfgFile tests for the MMGen test.py test suite
 
 
 import shutil
 import shutil
 
 
-from test.common import *
-from test.test_py_d.ts_base import *
+from ..include.common import *
+from .ts_base import *
 from mmgen.cfg import *
 from mmgen.cfg import *
 
 
 class TestSuiteCfg(TestSuiteBase):
 class TestSuiteCfg(TestSuiteBase):

+ 5 - 5
test/test_py_d/ts_chainsplit.py

@@ -24,12 +24,12 @@ import os
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.util import die
 from mmgen.util import die
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
-from test.test_py_d.ts_regtest import *
+from .ts_base import *
+from .ts_shared import *
+from .ts_regtest import *
 
 
 class TestSuiteChainsplit(TestSuiteRegtest):
 class TestSuiteChainsplit(TestSuiteRegtest):
 	'forking scenario tests for the test.py test suite'
 	'forking scenario tests for the test.py test suite'

+ 4 - 4
test/test_py_d/ts_ethdev.py

@@ -28,8 +28,8 @@ from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.util import die
 from mmgen.util import die
 from mmgen.exception import *
 from mmgen.exception import *
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
 del_addrs = ('4','1')
 del_addrs = ('4','1')
 dfl_sid = '98831F3A'
 dfl_sid = '98831F3A'
@@ -132,8 +132,8 @@ token_bals_getbalance = {
 	'2': ('111.888877776666555545','888.111122223333444455')
 	'2': ('111.888877776666555545','888.111122223333444455')
 }
 }
 
 
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from .ts_base import *
+from .ts_shared import *
 
 
 class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 	'Ethereum transacting, token deployment and tracking wallet operations'
 	'Ethereum transacting, token deployment and tracking wallet operations'

+ 3 - 2
test/test_py_d/ts_input.py

@@ -10,8 +10,9 @@
 ts_input.py: user input tests for the MMGen test.py test suite
 ts_input.py: user input tests for the MMGen test.py test suite
 """
 """
 
 
-from test.common import *
-from test.test_py_d.ts_base import *
+from ..include.common import *
+from .ts_base import *
+from .input import *
 from mmgen.seed import SeedSource
 from mmgen.seed import SeedSource
 
 
 class TestSuiteInput(TestSuiteBase):
 class TestSuiteInput(TestSuiteBase):

+ 4 - 4
test/test_py_d/ts_main.py

@@ -23,10 +23,10 @@ ts_main.py: Basic operations tests for the test.py test suite
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.seed import SeedSource,Wallet,MMGenMnemonic,IncogWallet,MMGenSeedFile
 from mmgen.seed import SeedSource,Wallet,MMGenMnemonic,IncogWallet,MMGenSeedFile
-from test.common import *
-from test.test_py_d.common import *
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from ..include.common import *
+from .common import *
+from .ts_base import *
+from .ts_shared import *
 
 
 def make_brainwallet_file(fn):
 def make_brainwallet_file(fn):
 	# Print random words with random whitespace in between
 	# Print random words with random whitespace in between

+ 4 - 4
test/test_py_d/ts_misc.py

@@ -21,10 +21,10 @@ ts_misc.py: Miscellaneous test groups for the test.py test suite
 """
 """
 
 
 from mmgen.globalvars import g
 from mmgen.globalvars import g
-from test.common import *
-from test.test_py_d.common import *
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_main import TestSuiteMain
+from ..include.common import *
+from .common import *
+from .ts_base import *
+from .ts_main import TestSuiteMain
 
 
 class TestSuiteHelp(TestSuiteBase):
 class TestSuiteHelp(TestSuiteBase):
 	'help, info and usage screens'
 	'help, info and usage screens'

+ 2 - 2
test/test_py_d/ts_opts.py

@@ -10,8 +10,8 @@
 ts_opts.py: options processing tests for the MMGen test.py test suite
 ts_opts.py: options processing tests for the MMGen test.py test suite
 """
 """
 
 
-from test.common import *
-from test.test_py_d.ts_base import *
+from ..include.common import *
+from .ts_base import *
 
 
 class TestSuiteOpts(TestSuiteBase):
 class TestSuiteOpts(TestSuiteBase):
 	'options processing'
 	'options processing'

+ 4 - 4
test/test_py_d/ts_ref.py

@@ -24,11 +24,11 @@ import os
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.seed import MMGenMnemonic
 from mmgen.seed import MMGenMnemonic
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from .ts_base import *
+from .ts_shared import *
 
 
 wpasswd = 'reference password'
 wpasswd = 'reference password'
 nw_name = '{} {}'.format(g.coin,('Mainnet','Testnet')[g.testnet])
 nw_name = '{} {}'.format(g.coin,('Mainnet','Testnet')[g.testnet])

+ 5 - 5
test/test_py_d/ts_ref_3seed.py

@@ -24,11 +24,11 @@ ts_ref_3seed.py: Saved and generated reference file tests for 128, 192 and
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.seed import SeedSource
 from mmgen.seed import SeedSource
-from test.common import *
-from test.test_py_d.common import *
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
-from test.test_py_d.ts_wallet import TestSuiteWalletConv
+from ..include.common import *
+from .common import *
+from .ts_base import *
+from .ts_shared import *
+from .ts_wallet import TestSuiteWalletConv
 
 
 class TestSuiteRef3Seed(TestSuiteBase,TestSuiteShared):
 class TestSuiteRef3Seed(TestSuiteBase,TestSuiteShared):
 	'saved wallet files for 128-, 192- and 256-bit seeds + generated filename checks'
 	'saved wallet files for 128-, 192- and 256-bit seeds + generated filename checks'

+ 3 - 3
test/test_py_d/ts_ref_altcoin.py

@@ -23,9 +23,9 @@ ts_ref_altcoin.py: Altcoin reference file tests for the test.py test suite
 import os
 import os
 from mmgen.globalvars import g
 from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
-from test.test_py_d.common import *
-from test.test_py_d.ts_ref import *
-from test.test_py_d.ts_base import *
+from .common import *
+from .ts_ref import *
+from .ts_base import *
 
 
 class TestSuiteRefAltcoin(TestSuiteRef,TestSuiteBase):
 class TestSuiteRefAltcoin(TestSuiteRef,TestSuiteBase):
 	'saved and generated altcoin reference files'
 	'saved and generated altcoin reference files'

+ 4 - 4
test/test_py_d/ts_regtest.py

@@ -28,8 +28,8 @@ from mmgen.util import die,gmsg,write_data_to_file
 from mmgen.protocol import CoinProtocol
 from mmgen.protocol import CoinProtocol
 from mmgen.addr import AddrList
 from mmgen.addr import AddrList
 from mmgen.seed import Wallet
 from mmgen.seed import Wallet
-from test.common import *
-from test.test_py_d.common import *
+from ..include.common import *
+from .common import *
 
 
 dfl_wcls = Wallet
 dfl_wcls = Wallet
 rt_pw = 'abc-α'
 rt_pw = 'abc-α'
@@ -128,8 +128,8 @@ rt_data = {
 	}
 	}
 }
 }
 
 
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from .ts_base import *
+from .ts_shared import *
 
 
 class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 	'transacting and tracking wallet operations via regtest mode'
 	'transacting and tracking wallet operations via regtest mode'

+ 1 - 1
test/test_py_d/ts_seedsplit.py

@@ -24,7 +24,7 @@ from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.seed import SeedSource,Wallet,IncogWallet,IncogWalletHex,IncogWalletHidden,SeedSourceEnc
 from mmgen.seed import SeedSource,Wallet,IncogWallet,IncogWalletHex,IncogWalletHidden,SeedSourceEnc
 
 
-from test.test_py_d.ts_base import *
+from .ts_base import *
 
 
 ref_wf = 'test/ref/98831F3A.bip39'
 ref_wf = 'test/ref/98831F3A.bip39'
 ref_sid = '98831F3A'
 ref_sid = '98831F3A'

+ 2 - 2
test/test_py_d/ts_shared.py

@@ -25,8 +25,8 @@ from mmgen.globalvars import g
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.util import ymsg
 from mmgen.util import ymsg
 from mmgen.seed import SeedSource,SeedSourceEnc,Brainwallet,Wallet,IncogWalletHidden
 from mmgen.seed import SeedSource,SeedSourceEnc,Brainwallet,Wallet,IncogWalletHidden
-from test.test_py_d.common import *
-from test.common import *
+from ..include.common import *
+from .common import *
 
 
 class TestSuiteShared(object):
 class TestSuiteShared(object):
 	'shared methods for the test.py test suite'
 	'shared methods for the test.py test suite'

+ 3 - 3
test/test_py_d/ts_tool.py

@@ -10,9 +10,9 @@
 ts_tool.py: tool tests for the MMGen test.py test suite
 ts_tool.py: tool tests for the MMGen test.py test suite
 """
 """
 
 
-from test.common import *
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_main import TestSuiteMain
+from ..include.common import *
+from .ts_base import *
+from .ts_main import TestSuiteMain
 
 
 class TestSuiteTool(TestSuiteMain,TestSuiteBase):
 class TestSuiteTool(TestSuiteMain,TestSuiteBase):
 	"interactive 'mmgen-tool' commands"
 	"interactive 'mmgen-tool' commands"

+ 3 - 3
test/test_py_d/ts_wallet.py

@@ -23,9 +23,9 @@ ts_wallet.py: Wallet conversion tests for the test.py test suite
 import os
 import os
 from mmgen.opts import opt
 from mmgen.opts import opt
 from mmgen.seed import *
 from mmgen.seed import *
-from test.test_py_d.common import *
-from test.test_py_d.ts_base import *
-from test.test_py_d.ts_shared import *
+from .common import *
+from .ts_base import *
+from .ts_shared import *
 
 
 class TestSuiteWalletConv(TestSuiteBase,TestSuiteShared):
 class TestSuiteWalletConv(TestSuiteBase,TestSuiteShared):
 	'wallet conversion to and from reference data'
 	'wallet conversion to and from reference data'

+ 2 - 2
test/tooltest.py

@@ -23,9 +23,9 @@ test/tooltest.py:  Tests for the 'mmgen-tool' utility
 import sys,os,binascii
 import sys,os,binascii
 from subprocess import run,PIPE
 from subprocess import run,PIPE
 
 
-from tests_header import repo_root
+from include.tests_header import repo_root
 from mmgen.common import *
 from mmgen.common import *
-from test.common import *
+from test.include.common import *
 
 
 opts_data = {
 opts_data = {
 	'text': {
 	'text': {

+ 2 - 2
test/tooltest2.py

@@ -27,9 +27,9 @@ import sys,os,time
 from subprocess import run,PIPE
 from subprocess import run,PIPE
 from decimal import Decimal
 from decimal import Decimal
 
 
-from tests_header import repo_root
+from include.tests_header import repo_root
 from mmgen.common import *
 from mmgen.common import *
-from test.common import *
+from test.include.common import *
 from mmgen.obj import is_wif,is_coin_addr
 from mmgen.obj import is_wif,is_coin_addr
 from mmgen.seed import is_bip39_mnemonic,is_mmgen_mnemonic
 from mmgen.seed import is_bip39_mnemonic,is_mmgen_mnemonic
 from mmgen.addr import is_xmrseed
 from mmgen.addr import is_xmrseed

+ 1 - 1
test/unit_tests.py

@@ -22,7 +22,7 @@ test/unit_tests.py:  Unit tests for the MMGen suite
 
 
 import sys,os,time
 import sys,os,time
 
 
-from tests_header import repo_root
+from include.tests_header import repo_root
 from mmgen.common import *
 from mmgen.common import *
 
 
 opts_data = {
 opts_data = {

+ 1 - 1
test/unit_tests_d/ut_scrypt.py

@@ -3,7 +3,7 @@
 test/unit_tests_d/ut_scrypt.py: password hashing unit test for the MMGen suite
 test/unit_tests_d/ut_scrypt.py: password hashing unit test for the MMGen suite
 """
 """
 
 
-from test.common import *
+from ..include.common import *
 
 
 class unit_test(object):
 class unit_test(object):
 
 

+ 1 - 1
test/unit_tests_d/ut_tx_deserialize.py

@@ -5,7 +5,7 @@ test/unit_tests_d/ut_tx_deserialize: TX deserialization unit test for the MMGen
 
 
 import os
 import os
 from mmgen.common import *
 from mmgen.common import *
-from test.common import *
+from ..include.common import *
 
 
 class unit_test(object):
 class unit_test(object):