1
0

tests: add unittest for Abstract_Wallet.export_history_to_file

Adds unittest for Abstract_Wallet.export_history_to_file that
compares the output against reference files. This
should help to prevent regressions and ensure the layout
of the export stays static over time.
This commit is contained in:
f321x
2026-01-28 12:46:52 +01:00
parent e1dac558dd
commit a6a57f0fec
8 changed files with 1955 additions and 6 deletions

View File

@@ -35,9 +35,10 @@ electrum.util.AS_LIB_USER_I_WANT_TO_MANAGE_MY_OWN_ASYNCIO_LOOP = True
class ElectrumTestCase(unittest.IsolatedAsyncioTestCase, Logger):
"""Base class for our unit tests."""
TESTNET = False
TESTNET = False # there is also an @as_testnet decorator to run single tests in testnet mode
REGTEST = False
TEST_ANCHOR_CHANNELS = False
WALLET_FILES_DIR = os.path.join(os.path.dirname(__file__), "test_storage_upgrade")
# maxDiff = None # for debugging
# some unit tests are modifying globals... so we run sequentially:
@@ -110,6 +111,9 @@ class ElectrumTestCase(unittest.IsolatedAsyncioTestCase, Logger):
self._lnworkers_created.append(lnwallet)
return lnwallet
def get_wallet_file_path(self, wallet_name: str) -> str:
return os.path.join(self.WALLET_FILES_DIR, wallet_name)
def as_testnet(func):
"""Function decorator to run a single unit test in testnet mode.