Browse Source

pylint (test suite) - non-interpolated f-strings

The MMGen Project 1 year ago
parent
commit
a0fe92f832

+ 2 - 2
test/misc/get_passphrase.py

@@ -11,7 +11,7 @@ from mmgen.util import msg
 opts_data = {
 opts_data = {
 	'text': {
 	'text': {
 		'desc':    '',
 		'desc':    '',
-		'usage':   f'crypto | seed',
+		'usage':   'crypto | seed',
 		'options': """
 		'options': """
 -h, --help            Print this help message
 -h, --help            Print this help message
 -P, --passwd-file=f   a
 -P, --passwd-file=f   a
@@ -57,7 +57,7 @@ def seed():
 		w2 = Wallet(cfg,ss=w1,passchg=True)
 		w2 = Wallet(cfg,ss=w1,passchg=True)
 		msg(f'\n==> got pw,preset,lbl: [{w2.ssdata.passwd}][{w2.ssdata.hash_preset}][{w2.ssdata.label}]\n')
 		msg(f'\n==> got pw,preset,lbl: [{w2.ssdata.passwd}][{w2.ssdata.hash_preset}][{w2.ssdata.label}]\n')
 
 
-	msg(f'------- WALLET FROM FILE -------\n')
+	msg('------- WALLET FROM FILE -------\n')
 	w3 = Wallet(cfg,fn='test/ref/FE3C6545-D782B529[128,1].mmdat') # passphrase: 'reference password'
 	w3 = Wallet(cfg,fn='test/ref/FE3C6545-D782B529[128,1].mmdat') # passphrase: 'reference password'
 	msg(f'\n==> got pw,preset,lbl: [{w3.ssdata.passwd}][{w3.ssdata.hash_preset}][{w3.ssdata.label}]\n')
 	msg(f'\n==> got pw,preset,lbl: [{w3.ssdata.passwd}][{w3.ssdata.hash_preset}][{w3.ssdata.label}]\n')
 
 

+ 1 - 1
test/overlay/__init__.py

@@ -29,7 +29,7 @@ def overlay_setup(repo_root):
 			if (
 			if (
 				fn.endswith('.py') or
 				fn.endswith('.py') or
 				d == f'{pkgname}.data' or
 				d == f'{pkgname}.data' or
-				(d == f'mmgen.proto.secp256k1' and fn.startswith('secp256k1'))
+				(d == 'mmgen.proto.secp256k1' and fn.startswith('secp256k1'))
 			):
 			):
 				if os.path.exists(os.path.join(fakemod_dir,fn)):
 				if os.path.exists(os.path.join(fakemod_dir,fn)):
 					make_link(
 					make_link(

+ 1 - 1
test/test.py

@@ -572,7 +572,7 @@ class TestSuiteRunner:
 			self.pre_args = ['python3'] if gc.platform == 'win' else []
 			self.pre_args = ['python3'] if gc.platform == 'win' else []
 
 
 		if cfg.pexpect_spawn:
 		if cfg.pexpect_spawn:
-			omsg(f'INFO → Using pexpect.spawn() for real terminal emulation')
+			omsg('INFO → Using pexpect.spawn() for real terminal emulation')
 
 
 		self.set_spawn_env()
 		self.set_spawn_env()
 
 

+ 3 - 3
test/test_py_d/ts_ethdev.py

@@ -958,7 +958,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 		imsg(f'Gas used:  {res.gas_used.hl():<9} {(res.gas_used*res.gas_price).hl2(encl="()")}')
 		imsg(f'Gas used:  {res.gas_used.hl():<9} {(res.gas_used*res.gas_price).hl2(encl="()")}')
 		imsg(f'Gas price: {res.gas_price.hl()}')
 		imsg(f'Gas price: {res.gas_price.hl()}')
 		if res.gas_used == res.gas_sent:
 		if res.gas_used == res.gas_sent:
-			omsg(yellow(f'Warning: all gas was used!'))
+			omsg(yellow('Warning: all gas was used!'))
 		return res
 		return res
 
 
 	async def token_deploy(self,num,key,gas,mmgen_cmd='txdo',tx_fee='8G'):
 	async def token_deploy(self,num,key,gas,mmgen_cmd='txdo',tx_fee='8G'):
@@ -1410,7 +1410,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 		self.spawn('',msg_only=True)
 		self.spawn('',msg_only=True)
 		from mmgen.tw.ctl import TwCtl
 		from mmgen.tw.ctl import TwCtl
 		twctl = await TwCtl(cfg,self.proto)
 		twctl = await TwCtl(cfg,self.proto)
-		imsg(f'Moving tracking wallet')
+		imsg('Moving tracking wallet')
 		bakfile = twctl.tw_fn + '.bak.json'
 		bakfile = twctl.tw_fn + '.bak.json'
 		if os.path.exists(bakfile):
 		if os.path.exists(bakfile):
 			os.unlink(bakfile)
 			os.unlink(bakfile)
@@ -1443,7 +1443,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 		from mmgen.tw.ctl import TwCtl
 		from mmgen.tw.ctl import TwCtl
 		twctl = await TwCtl(cfg,self.proto)
 		twctl = await TwCtl(cfg,self.proto)
 		fn = twctl.tw_fn
 		fn = twctl.tw_fn
-		imsg(f'Comparing imported tracking wallet with original')
+		imsg('Comparing imported tracking wallet with original')
 		data = [json.dumps(json.loads(read_from_file(f)),sort_keys=True) for f in (fn,fn+'.bak.json')]
 		data = [json.dumps(json.loads(read_from_file(f)),sort_keys=True) for f in (fn,fn+'.bak.json')]
 		cmp_or_die(*data,'tracking wallets')
 		cmp_or_die(*data,'tracking wallets')
 		return 'ok'
 		return 'ok'

+ 5 - 5
test/test_py_d/ts_misc.py

@@ -54,7 +54,7 @@ class TestSuiteMisc(TestSuiteBase):
 
 
 	def xmrwallet_txview(self,op='txview'):
 	def xmrwallet_txview(self,op='txview'):
 		files = get_file_with_ext('test/ref/monero','tx',no_dot=True,delete=False,return_list=True)
 		files = get_file_with_ext('test/ref/monero','tx',no_dot=True,delete=False,return_list=True)
-		t = self.spawn( f'mmgen-xmrwallet', [op] + files )
+		t = self.spawn( 'mmgen-xmrwallet', [op] + files )
 		res = t.read(strip_color=True)
 		res = t.read(strip_color=True)
 		if op == 'txview':
 		if op == 'txview':
 			for s in (
 			for s in (
@@ -75,7 +75,7 @@ class TestSuiteMisc(TestSuiteBase):
 		else:
 		else:
 			coins = ['btc','ltc','eth']
 			coins = ['btc','ltc','eth']
 			start_test_daemons('ltc','eth')
 			start_test_daemons('ltc','eth')
-		t = self.spawn(f'examples/coin-daemon-info.py',coins,cmd_dir='.')
+		t = self.spawn('examples/coin-daemon-info.py',coins,cmd_dir='.')
 		for coin in coins:
 		for coin in coins:
 			t.expect(coin.upper() + r'\s+mainnet\s+Up',regex=True)
 			t.expect(coin.upper() + r'\s+mainnet\s+Up',regex=True)
 		if cfg.pexpect_spawn:
 		if cfg.pexpect_spawn:
@@ -137,20 +137,20 @@ class TestSuiteHelp(TestSuiteBase):
 	)
 	)
 
 
 	def usage(self):
 	def usage(self):
-		t = self.spawn(f'mmgen-walletgen',['foo'])
+		t = self.spawn('mmgen-walletgen',['foo'])
 		t.expect('MMGenSystemExit(1)')
 		t.expect('MMGenSystemExit(1)')
 		t.expect('USAGE: mmgen-walletgen')
 		t.expect('USAGE: mmgen-walletgen')
 		t.req_exit_val = 1
 		t.req_exit_val = 1
 		return t
 		return t
 
 
 	def version(self):
 	def version(self):
-		t = self.spawn(f'mmgen-tool',['--version'])
+		t = self.spawn('mmgen-tool',['--version'])
 		t.expect('MMGEN-TOOL version')
 		t.expect('MMGEN-TOOL version')
 		return t
 		return t
 
 
 	def license(self):
 	def license(self):
 		t = self.spawn(
 		t = self.spawn(
-			f'mmgen-walletconv',
+			'mmgen-walletconv',
 			['--stdout','--in-fmt=hex','--out-fmt=hex'],
 			['--stdout','--in-fmt=hex','--out-fmt=hex'],
 			env = {'MMGEN_NO_LICENSE':''} )
 			env = {'MMGEN_NO_LICENSE':''} )
 		t.expect('to continue: ', 'w')
 		t.expect('to continue: ', 'w')

+ 6 - 6
test/test_py_d/ts_regtest.py

@@ -598,7 +598,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 			if batch:
 			if batch:
 				t.expect(f'{num_addrs} addresses imported')
 				t.expect(f'{num_addrs} addresses imported')
 			else:
 			else:
-				t.expect(f'import completed OK')
+				t.expect('import completed OK')
 			t.ok()
 			t.ok()
 
 
 		t.skip_ok = True
 		t.skip_ok = True
@@ -654,11 +654,11 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		rt = MMGenRegtest(cfg,self.proto.coin)
 		rt = MMGenRegtest(cfg,self.proto.coin)
 		await rt.stop()
 		await rt.stop()
 		from shutil import rmtree
 		from shutil import rmtree
-		imsg(f'Deleting Bob’s old tracking wallet')
+		imsg('Deleting Bob’s old tracking wallet')
 		rmtree(os.path.join(rt.d.datadir,'regtest','wallets','bob'),ignore_errors=True)
 		rmtree(os.path.join(rt.d.datadir,'regtest','wallets','bob'),ignore_errors=True)
 		rt.init_daemon()
 		rt.init_daemon()
 		rt.d.start(silent=True)
 		rt.d.start(silent=True)
-		imsg(f'Creating Bob’s new tracking wallet')
+		imsg('Creating Bob’s new tracking wallet')
 		await rt.rpc_call('createwallet','bob',True,True,None,False,False,False)
 		await rt.rpc_call('createwallet','bob',True,True,None,False,False,False)
 		await rt.stop()
 		await rt.stop()
 		await rt.start()
 		await rt.start()
@@ -1303,7 +1303,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		assert self.proto.cap('segwit')
 		assert self.proto.cap('segwit')
 		if not hasattr(self,'_b_start_'):
 		if not hasattr(self,'_b_start_'):
 			t = self.spawn( 'mmgen-tool', ['--color=0','--bob','listaddresses'], no_msg=True )
 			t = self.spawn( 'mmgen-tool', ['--color=0','--bob','listaddresses'], no_msg=True )
-			self._b_start_ = int([e for e in t.read().split('\n') if f':B:1' in e][0].split()[0].rstrip(')'))
+			self._b_start_ = int([e for e in t.read().split('\n') if ':B:1' in e][0].split()[0].rstrip(')'))
 			t.close()
 			t.close()
 		return self._b_start_
 		return self._b_start_
 
 
@@ -1389,14 +1389,14 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		return self.spawn('mmgen-tool',['--carol','listaddresses','showempty=1'])
 		return self.spawn('mmgen-tool',['--carol','listaddresses','showempty=1'])
 
 
 	async def carol_delete_wallet(self):
 	async def carol_delete_wallet(self):
-		imsg(f'Unloading Carol’s tracking wallet')
+		imsg('Unloading Carol’s tracking wallet')
 		t = self.spawn('mmgen-regtest',['cli','unloadwallet','carol'])
 		t = self.spawn('mmgen-regtest',['cli','unloadwallet','carol'])
 		t.ok()
 		t.ok()
 		from mmgen.rpc import rpc_init
 		from mmgen.rpc import rpc_init
 		rpc = await rpc_init(cfg,self.proto)
 		rpc = await rpc_init(cfg,self.proto)
 		wdir = joinpath(rpc.daemon.network_datadir,'wallets','carol')
 		wdir = joinpath(rpc.daemon.network_datadir,'wallets','carol')
 		from shutil import rmtree
 		from shutil import rmtree
-		imsg(f'Deleting Carol’s tracking wallet')
+		imsg('Deleting Carol’s tracking wallet')
 		rmtree(wdir)
 		rmtree(wdir)
 		return 'silent'
 		return 'silent'
 
 

+ 1 - 1
test/test_py_d/ts_xmrwallet.py

@@ -783,7 +783,7 @@ class TestSuiteXMRWallet(TestSuiteBase):
 			t = tool_api(cfg)
 			t = tool_api(cfg)
 			t.init_coin('XMR','mainnet')
 			t.init_coin('XMR','mainnet')
 			t.usr_randchars = 0
 			t.usr_randchars = 0
-			imsg_r(f'Sending random transactions: ')
+			imsg_r('Sending random transactions: ')
 			for i in range(random_txs):
 			for i in range(random_txs):
 				await self.transfer(
 				await self.transfer(
 					'miner',
 					'miner',