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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user