Skip to content

Commit ee67bba

Browse files
committed
test: added test coverage to loadtxoutset
The functional test coverage did not cover the rpc error of Couldn't open file for loadtxoutset and this test adds coverage for it
1 parent 1ffbd96 commit ee67bba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/functional/feature_assumeutxo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ def test_invalid_mempool_state(self, dump_output_path):
152152

153153
self.restart_node(2, extra_args=self.extra_args[2])
154154

155+
def test_invalid_file_path(self):
156+
self.log.info("Test bitcoind should fail when file path is invalid.")
157+
node = self.nodes[0]
158+
path = node.datadir_path / node.chain / "invalid" / "path"
159+
assert_raises_rpc_error(-8, "Couldn't open file {} for reading.".format(path), node.loadtxoutset, path)
160+
155161
def run_test(self):
156162
"""
157163
Bring up two (disconnected) nodes, mine some new blocks on the first,
@@ -236,6 +242,7 @@ def run_test(self):
236242
self.test_invalid_mempool_state(dump_output['path'])
237243
self.test_invalid_snapshot_scenarios(dump_output['path'])
238244
self.test_invalid_chainstate_scenarios()
245+
self.test_invalid_file_path()
239246

240247
self.log.info(f"Loading snapshot into second node from {dump_output['path']}")
241248
loaded = n1.loadtxoutset(dump_output['path'])

0 commit comments

Comments
 (0)