aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_bitcoin_cli.py
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2022-12-02 17:37:08 -0500
committerRyan Ofsky <ryan@ofsky.org>2022-12-02 17:37:08 -0500
commite2c3b18e671e347e422d696d1cbdd9f82b2ce468 (patch)
tree536d59876cda33e4b528d392157ddbd977dc69ff /test/functional/interface_bitcoin_cli.py
parent78aee0fe2ca72e7bc0f36e7479574ebc1f6a9bee (diff)
downloadbitcoin-e2c3b18e671e347e422d696d1cbdd9f82b2ce468.tar.xz
test: Add RPC tests for same named parameter specified more than once
Current behavior isn't ideal and will be changed in upcoming commits, but it's useful to have test coverage regardless. MarcoFalke reported the case of bitcoin-cli positional arguments overwriting the named "args" parameter in https://github.com/bitcoin/bitcoin/pull/19762#discussion_r1035761471
Diffstat (limited to 'test/functional/interface_bitcoin_cli.py')
-rwxr-xr-xtest/functional/interface_bitcoin_cli.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py
index b1369c2615..afba8dba85 100755
--- a/test/functional/interface_bitcoin_cli.py
+++ b/test/functional/interface_bitcoin_cli.py
@@ -90,6 +90,10 @@ class TestBitcoinCli(BitcoinTestFramework):
assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", self.nodes[0].cli.echo, 0, 1, arg1=1)
assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", self.nodes[0].cli.echo, 0, None, 2, arg1=1)
+ self.log.info("Test that later cli named arguments values silently overwrite earlier ones")
+ assert_equal(self.nodes[0].cli("-named", "echo", "arg0=0", "arg1=1", "arg2=2", "arg1=3").send_cli(), ['0', '3', '2'])
+ assert_equal(self.nodes[0].cli("-named", "echo", "args=[0,1,2,3]", "4", "5", "6", ).send_cli(), ['4', '5', '6'])
+
user, password = get_auth_cookie(self.nodes[0].datadir, self.chain)
self.log.info("Test -stdinrpcpass option")