From 9e54d9f3b6546cc054d2366c731148904697bdb0 Mon Sep 17 00:00:00 2001 From: timemarkovqtum Date: Tue, 21 May 2024 15:48:26 +0200 Subject: [PATCH] Fix datadir path in tests --- test/functional/qtum_delegation_contract.py | 6 +++--- test/functional/qtum_header_spam.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/functional/qtum_delegation_contract.py b/test/functional/qtum_delegation_contract.py index 039bdfe3d4..2ce45711ee 100755 --- a/test/functional/qtum_delegation_contract.py +++ b/test/functional/qtum_delegation_contract.py @@ -551,9 +551,9 @@ def run_test(self): self.staker_privkey = self.staker.dumpprivkey(self.staker_address) self.staker_eckey = wif_to_ECKey(self.staker_privkey) - self.wallet_clean_path = os.path.join(self.nodes[5].datadir, 'regtest', 'wallets') - self.wallet_path = os.path.join(self.staker.datadir, 'regtest', 'wallets') - self.wallet_backup_path = os.path.join(self.staker.datadir, 'regtest', 'backup_wallets') + self.wallet_clean_path = self.nodes[5].datadir_path / "regtest" / "wallets" + self.wallet_path = self.staker.datadir_path / "regtest" / "wallets" + self.wallet_backup_path = self.staker.datadir_path / "regtest" / "backup_wallets" shutil.copytree(self.wallet_clean_path, self.wallet_backup_path) self.staker.generatetoaddress(1, self.staker_address) diff --git a/test/functional/qtum_header_spam.py b/test/functional/qtum_header_spam.py index 5a2f5bb373..6fed0e9908 100755 --- a/test/functional/qtum_header_spam.py +++ b/test/functional/qtum_header_spam.py @@ -212,7 +212,7 @@ def can_sync_after_offline_period_test(self): self.sync_blocks() def reorg_requires_more_chainwork_test(self): - old_size = get_dir_size(self.node.datadir+'/regtest/blocks/') + old_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path)) self.start_p2p_connection() tip = self.node.getblock(self.node.getblockhash(self.node.getblockcount() - 20)) @@ -246,13 +246,13 @@ def reorg_requires_more_chainwork_test(self): self.p2p_node.send_message(msg_block(block)) self.p2p_node.sync_with_ping() - new_size = get_dir_size(self.node.datadir+'/regtest/blocks/') + new_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path)) assert(new_size-old_size < 1000000) self.close_p2p_connection() def spam_same_stake_block_test(self): - old_size = get_dir_size(self.node.datadir+'/regtest/blocks/') + old_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path)) self.start_p2p_connection() tip = self.node.getblock(self.node.getblockhash(self.node.getblockcount()-1)) @@ -276,7 +276,7 @@ def spam_same_stake_block_test(self): self.p2p_node.send_message(msg_block(block)) time.sleep(10) - new_size = get_dir_size(self.node.datadir+'/regtest/blocks/') + new_size = get_dir_size("{}/regtest/blocks/".format(self.node.datadir_path)) assert(new_size-old_size < 1000000) self.close_p2p_connection()