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

This commit is contained in:
The MMGen Project 2023-10-11 12:58:52 +00:00
commit a0fe92f832
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
7 changed files with 19 additions and 19 deletions

View file

@ -11,7 +11,7 @@ from mmgen.util import msg
opts_data = {
'text': {
'desc': '',
'usage': f'crypto | seed',
'usage': 'crypto | seed',
'options': """
-h, --help Print this help message
-P, --passwd-file=f a
@ -57,7 +57,7 @@ def seed():
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'------- WALLET FROM FILE -------\n')
msg('------- WALLET FROM FILE -------\n')
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')

View file

@ -29,7 +29,7 @@ def overlay_setup(repo_root):
if (
fn.endswith('.py') 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)):
make_link(

View file

@ -572,7 +572,7 @@ class TestSuiteRunner:
self.pre_args = ['python3'] if gc.platform == 'win' else []
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()

View file

@ -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 price: {res.gas_price.hl()}')
if res.gas_used == res.gas_sent:
omsg(yellow(f'Warning: all gas was used!'))
omsg(yellow('Warning: all gas was used!'))
return res
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)
from mmgen.tw.ctl import TwCtl
twctl = await TwCtl(cfg,self.proto)
imsg(f'Moving tracking wallet')
imsg('Moving tracking wallet')
bakfile = twctl.tw_fn + '.bak.json'
if os.path.exists(bakfile):
os.unlink(bakfile)
@ -1443,7 +1443,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
from mmgen.tw.ctl import TwCtl
twctl = await TwCtl(cfg,self.proto)
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')]
cmp_or_die(*data,'tracking wallets')
return 'ok'

View file

@ -54,7 +54,7 @@ class TestSuiteMisc(TestSuiteBase):
def xmrwallet_txview(self,op='txview'):
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)
if op == 'txview':
for s in (
@ -75,7 +75,7 @@ class TestSuiteMisc(TestSuiteBase):
else:
coins = ['btc','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:
t.expect(coin.upper() + r'\s+mainnet\s+Up',regex=True)
if cfg.pexpect_spawn:
@ -137,20 +137,20 @@ class TestSuiteHelp(TestSuiteBase):
)
def usage(self):
t = self.spawn(f'mmgen-walletgen',['foo'])
t = self.spawn('mmgen-walletgen',['foo'])
t.expect('MMGenSystemExit(1)')
t.expect('USAGE: mmgen-walletgen')
t.req_exit_val = 1
return t
def version(self):
t = self.spawn(f'mmgen-tool',['--version'])
t = self.spawn('mmgen-tool',['--version'])
t.expect('MMGEN-TOOL version')
return t
def license(self):
t = self.spawn(
f'mmgen-walletconv',
'mmgen-walletconv',
['--stdout','--in-fmt=hex','--out-fmt=hex'],
env = {'MMGEN_NO_LICENSE':''} )
t.expect('to continue: ', 'w')

View file

@ -598,7 +598,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
if batch:
t.expect(f'{num_addrs} addresses imported')
else:
t.expect(f'import completed OK')
t.expect('import completed OK')
t.ok()
t.skip_ok = True
@ -654,11 +654,11 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
rt = MMGenRegtest(cfg,self.proto.coin)
await rt.stop()
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)
rt.init_daemon()
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.stop()
await rt.start()
@ -1303,7 +1303,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
assert self.proto.cap('segwit')
if not hasattr(self,'_b_start_'):
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()
return self._b_start_
@ -1389,14 +1389,14 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
return self.spawn('mmgen-tool',['--carol','listaddresses','showempty=1'])
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.ok()
from mmgen.rpc import rpc_init
rpc = await rpc_init(cfg,self.proto)
wdir = joinpath(rpc.daemon.network_datadir,'wallets','carol')
from shutil import rmtree
imsg(f'Deleting Carol’s tracking wallet')
imsg('Deleting Carol’s tracking wallet')
rmtree(wdir)
return 'silent'

View file

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