test: wallet: Check direct file backup name.

This check ensures that when migrating a legacy wallet with a direct
filename, the backup file is named as expected.

Co-authored-by: Ava Chow <github@achow101.com>
This commit is contained in:
David Gumberg 2025-06-30 14:46:33 -07:00
parent 9f713b83dc
commit e22c3599c6

View File

@ -584,7 +584,10 @@ class WalletMigrationTest(BitcoinTestFramework):
)
assert (self.master_node.wallets_path / "plainfile").is_file()
self.master_node.migratewallet("plainfile")
mocked_time = int(time.time())
self.master_node.setmocktime(mocked_time)
migrate_res = self.master_node.migratewallet("plainfile")
assert_equal(f"plainfile_{mocked_time}.legacy.bak", os.path.basename(migrate_res["backup_path"]))
wallet = self.master_node.get_wallet_rpc("plainfile")
info = wallet.getwalletinfo()
assert_equal(info["descriptors"], True)