Skip to content

Commit fae7b14

Browse files
author
MarcoFalke
committed
qa: Make TestNodeCLI command optional in send_cli
1 parent ffffb10 commit fae7b14

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/functional/bitcoin_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def run_test(self):
3939
assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help)
4040

4141
self.log.info("Compare responses from `bitcoin-cli -getinfo` and the RPCs data is retrieved from.")
42-
cli_get_info = self.nodes[0].cli().send_cli('-getinfo')
42+
cli_get_info = self.nodes[0].cli('-getinfo').send_cli()
4343
wallet_info = self.nodes[0].getwalletinfo()
4444
network_info = self.nodes[0].getnetworkinfo()
4545
blockchain_info = self.nodes[0].getblockchaininfo()

test/functional/test_framework/test_node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def batch(self, requests):
238238
results.append(dict(error=e))
239239
return results
240240

241-
def send_cli(self, command, *args, **kwargs):
241+
def send_cli(self, command=None, *args, **kwargs):
242242
"""Run bitcoin-cli command. Deserializes returned string as python object."""
243243

244244
pos_args = [str(arg) for arg in args]
@@ -247,7 +247,9 @@ def send_cli(self, command, *args, **kwargs):
247247
p_args = [self.binary, "-datadir=" + self.datadir] + self.options
248248
if named_args:
249249
p_args += ["-named"]
250-
p_args += [command] + pos_args + named_args
250+
if command is not None:
251+
p_args += [command]
252+
p_args += pos_args + named_args
251253
self.log.debug("Running bitcoin-cli command: %s" % command)
252254
process = subprocess.Popen(p_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
253255
cli_stdout, cli_stderr = process.communicate(input=self.input)

0 commit comments

Comments
 (0)