modtest.py, daemontest.py: remove prefixes from test files

This commit is contained in:
The MMGen Project 2025-03-17 18:29:11 +03:00
commit 8b504c895a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
32 changed files with 47 additions and 49 deletions

View file

@ -36,10 +36,10 @@ ignore = [
]
"test/include/common.py" = [ "F821" ] # undefined name 'cfg'
"test/misc/input_func.py" = [ "F401" ] # imported but unused
"test/modtest_d/ut_cashaddr.py" = [ "F841" ] # assigned to but never used
"test/modtest_d/ut_dep.py" = [ "F401" ] # imported but unused
"test/modtest_d/ut_testdep.py" = [ "F401" ] # imported but unused
"test/modtest_d/ut_obj.py" = [ "F841" ] # assigned to but never used
"test/modtest_d/cashaddr.py" = [ "F841" ] # assigned to but never used
"test/modtest_d/dep.py" = [ "F401" ] # imported but unused
"test/modtest_d/testdep.py" = [ "F401" ] # imported but unused
"test/modtest_d/obj.py" = [ "F841" ] # assigned to but never used
"test/objtest_d/*" = [ "F401" ] # imported but unused
"test/objattrtest_d/*" = [ "F401" ] # imported but unused
"test/overlay/fakemods/*" = [ "F403", "F405" ] # `import *` used
@ -61,7 +61,7 @@ ignore = [
"pyethereum",
"rlp",
"main_split.py",
"ut_tx.py",
"tx.py",
]
ignored-modules = [ # ignored for no-member, otherwise checked
"mmgen.proto.secp256k1.secp256k1",

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.daemontest_d.ut_exec: unit test for the MMGen suite's Daemon class
test.daemontest_d.exec: unit test for the MMGen suite's Daemon class
"""
from subprocess import run, PIPE

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.daemontest_d.ut_msg: message signing unit tests for the MMGen suite
test.daemontest_d.msg: message signing unit tests for the MMGen suite
"""
import os

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.daemontest_d.ut_rpc: RPC unit test for the MMGen suite
test.daemontest_d.rpc: RPC unit test for the MMGen suite
"""
import sys, os

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.daemontest_d.ut_tx: TX daemon tests for the MMGen suite
test.daemontest_d.tx: TX daemon tests for the MMGen suite
"""
import json

View file

@ -77,8 +77,6 @@ type(cfg)._reset_ok += ('use_internal_keccak_module', 'debug_addrlist')
set_globals(cfg)
file_pfx = 'ut_'
test_type = {
'modtest.py': 'unit',
'daemontest.py': 'daemon',
@ -88,7 +86,7 @@ test_subdir = gc.prog_name.removesuffix('.py') + '_d'
test_dir = os.path.join(repo_root, 'test', test_subdir)
all_tests = sorted(fn[len(file_pfx):-len('.py')] for fn in os.listdir(test_dir) if fn.startswith(file_pfx))
all_tests = sorted(fn.removesuffix('.py') for fn in os.listdir(test_dir) if not fn.startswith('_'))
exclude = cfg.exclude.split(',') if cfg.exclude else []
@ -105,7 +103,7 @@ if cfg.list:
if cfg.list_subtests:
def gen():
for test in all_tests:
mod = importlib.import_module(f'test.{test_subdir}.{file_pfx}{test}')
mod = importlib.import_module(f'test.{test_subdir}.{test}')
if hasattr(mod, 'unit_tests'):
t = getattr(mod, 'unit_tests')
subtests = [k for k, v in t.__dict__.items() if type(v).__name__ == 'function' and k[0] != '_']
@ -154,7 +152,7 @@ class UnitTestHelpers:
tests_seen = []
def run_test(test, subtest=None):
mod = importlib.import_module(f'test.{test_subdir}.{file_pfx}{test}')
mod = importlib.import_module(f'test.{test_subdir}.{test}')
def run_subtest(t, subtest):
subtest_disp = subtest.replace('_', '-')

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_addrlist: address list unit tests for the MMGen suite
test.modtest_d.addrlist: address list unit tests for the MMGen suite
"""
from mmgen.color import blue

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_addrparse: address parsing tests for the MMGen suite
test.modtest_d.addrparse: address parsing tests for the MMGen suite
"""
from mmgen.color import yellow, cyan
@ -21,7 +21,7 @@ vectors = {
{'std': 'ltc1qvmqas4maw7lg9clqu6kqu9zq9cluvllnst5pxs'}
],
'xmr_mainnet': [
{ # ut_xmrseed.vectors[0]:
{ # xmrseed.vectors[0]:
'std': '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm',
# https://github.com/monero-project/monero/tests/functional_tests/integrated_address.py
'int': '4CMe2PUhs4J4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfSbLRB61BQVATzerHGj',

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_amt: CoinAmt unit tests for the MMGen suite
test.modtest_d.amt: CoinAmt unit tests for the MMGen suite
"""
from decimal import Decimal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_baseconv: Base conversion unit test for the MMGen suite
test.modtest_d.baseconv: Base conversion unit test for the MMGen suite
"""
from mmgen.util import msg, msg_r

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_bip39: BIP39 unit test for the MMGen suite
test.modtest_d.bip39: BIP39 unit test for the MMGen suite
"""
from mmgen.color import blue, orange, purple

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_bip_hd: bip_hd unit test for the MMGen suite
test.modtest_d.bip_hd: bip_hd unit test for the MMGen suite
"""
from mmgen.color import gray, pink, blue

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_cashaddr: unit test for the BCH cashaddr module
test.modtest_d.cashaddr: unit test for the BCH cashaddr module
"""
altcoin_dep = True

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_dep: dependency unit tests for the MMGen suite
test.modtest_d.dep: dependency unit tests for the MMGen suite
Test whether dependencies are installed and functional.
No data verification is performed.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_devtools: devtools unit tests for the MMGen suite
test.modtest_d.devtools: devtools unit tests for the MMGen suite
"""
import os, json

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_ecc: elliptic curve unit test for the MMGen suite
test.modtest_d.ecc: elliptic curve unit test for the MMGen suite
"""
from mmgen.proto.secp256k1.secp256k1 import pubkey_gen, pubkey_tweak_add, pubkey_check

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_flags: unit test for the MMGen suite's ClassFlags class
test.modtest_d.flags: unit test for the MMGen suite's ClassFlags class
"""
from mmgen.flags import ClassOpts, ClassFlags

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_gen: key/address generation unit tests for the MMGen suite
test.modtest_d.gen: key/address generation unit tests for the MMGen suite
"""
from mmgen.color import blue

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_indexed_dict: IndexedDict class unit test for the MMGen suite
test.modtest_d.indexed_dict: IndexedDict class unit test for the MMGen suite
"""
from mmgen.util import msg, msg_r, die

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
test.modtest_d.ut_lockable: unit test for the MMGen suite's Lockable class
test.modtest_d.lockable: unit test for the MMGen suite's Lockable class
"""
from decimal import Decimal

Some files were not shown because too many files have changed in this diff Show more