MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / test_wallet_settings

Method test_wallet_settings

test/functional/feature_settings.py:22–38  ·  view source on GitHub ↗
(self, settings_path)

Source from the content-addressed store, hash-verified

20 self.uses_wallet = None
21
22 def test_wallet_settings(self, settings_path):
23 if not self.is_wallet_compiled():
24 return
25
26 self.log.info("Testing wallet settings..")
27 node = self.nodes[0]
28 # Create wallet to use it during tests
29 self.start_node(0)
30 node.createwallet(wallet_name='w1')
31 self.stop_node(0)
32
33 # Verify wallet settings can only be strings. Either names or paths. Not booleans, nums nor anything else.
34 for wallets_data in [[10], [True], [[]], [{}], ["w1", 10], ["w1", False]]:
35 with settings_path.open("w") as fp:
36 json.dump({"wallet": wallets_data}, fp)
37 node.assert_start_raises_init_error(expected_msg="Error: Invalid value detected for '-wallet' or '-nowallet'. '-wallet' requires a string value, while '-nowallet' accepts only '1' to disable all wallets",
38 extra_args=[f'-settings={settings_path}'])
39
40 def run_test(self):
41 node, = self.nodes

Callers 1

run_testMethod · 0.95

Calls 6

is_wallet_compiledMethod · 0.80
infoMethod · 0.80
start_nodeMethod · 0.80
stop_nodeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected