test: Use pathlib over os.path #28362

revert netutil chgs py3.8 compliant

fixes based on PR review
This commit is contained in:
ns-xvrn
2023-09-02 01:09:43 -04:00
parent 04265ba937
commit bfa0bd632a
22 changed files with 138 additions and 168 deletions

View File

@ -6,7 +6,6 @@
import json
from pathlib import Path
from test_framework.test_framework import BitcoinTestFramework
from test_framework.test_node import ErrorMatch
@ -21,8 +20,8 @@ class SettingsTest(BitcoinTestFramework):
def run_test(self):
node, = self.nodes
settings = Path(node.chain_path, "settings.json")
conf = Path(node.datadir, "bitcoin.conf")
settings = node.chain_path / "settings.json"
conf = node.datadir_path / "bitcoin.conf"
# Assert empty settings file was created
self.stop_node(0)
@ -79,7 +78,7 @@ class SettingsTest(BitcoinTestFramework):
self.stop_node(0)
# Test alternate settings path
altsettings = Path(node.datadir, "altsettings.json")
altsettings = node.datadir_path / "altsettings.json"
with altsettings.open("w") as fp:
fp.write('{"key": "value"}')
with node.assert_debug_log(expected_msgs=['Setting file arg: key = "value"']):