aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-11-17 14:11:02 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-11-17 15:11:50 +0100
commitdcfef277b4920552f438c110390a5de93892a8de (patch)
tree8083a2d49b45dbd081862a8fd0fad7318cd07ecc /test/functional
parent1f7695b4194bd1d3872c9e91ad9ee271670894ea (diff)
cli: Reject arguments to -getinfo
Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trialing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`.
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/bitcoin_cli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/bitcoin_cli.py b/test/functional/bitcoin_cli.py
index 996cbb8a12..d1cd3b3620 100755
--- a/test/functional/bitcoin_cli.py
+++ b/test/functional/bitcoin_cli.py
@@ -35,8 +35,11 @@ class TestBitcoinCli(BitcoinTestFramework):
assert_equal(["foo", "bar"], self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input=password + "\nfoo\nbar").echo())
assert_raises_process_error(1, "incorrect rpcuser or rpcpassword", self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input="foo").echo)
+ self.log.info("Make sure that -getinfo with arguments fails")
+ assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help)
+
self.log.info("Compare responses from `bitcoin-cli -getinfo` and the RPCs data is retrieved from.")
- cli_get_info = self.nodes[0].cli('-getinfo').help()
+ cli_get_info = self.nodes[0].cli().send_cli('-getinfo')
wallet_info = self.nodes[0].getwalletinfo()
network_info = self.nodes[0].getnetworkinfo()
blockchain_info = self.nodes[0].getblockchaininfo()