mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
6edbc9cebd
* Merge #9956: Reorganise qa directory63d66ba
Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py (John Newbery)5b0bff4
Rename --enable-extended-rpc-tests to --enable-extended-functional-tests (John Newbery)a9bd622
Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py (John Newbery)c28ee91
Rename rpc-tests directory to functional (John Newbery)00902c4
Rename qa directory to test (John Newbery) Tree-SHA512: ee7125c0c647d81590177beef2c8852c4ef76fdcf888096d9d4d360562a01d8d3b453345c3040487b2a043935bd1e7e80018f34462d6e02262bedbe23edcc576 resolve build errors Signed-off-by: Pasta <Pasta@dash.org> update test_runner.py in testintegrations.sh Signed-off-by: Pasta <Pasta@dash.org> * moved dash specific tests Signed-off-by: Pasta <Pasta@dash.org> * dashify README.md Signed-off-by: Pasta <Pasta@dash.org> * removed autoix*.py Signed-off-by: Pasta <Pasta@dash.org> * change back file perms * dedashify Signed-off-by: Pasta <Pasta@dash.org>
48 lines
1.4 KiB
Python
Executable File
48 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright (c) 2016 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
"""Test using named arguments for RPCs."""
|
|
|
|
from test_framework.test_framework import BitcoinTestFramework
|
|
from test_framework.util import (
|
|
assert_equal,
|
|
assert_raises_jsonrpc,
|
|
start_nodes,
|
|
)
|
|
|
|
|
|
class NamedArgumentTest(BitcoinTestFramework):
|
|
"""
|
|
Test named arguments on RPC calls.
|
|
"""
|
|
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setup_clean_chain = False
|
|
self.num_nodes = 1
|
|
|
|
def setup_network(self, split=False):
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
|
|
self.is_network_split = False
|
|
self.sync_all()
|
|
|
|
def run_test(self):
|
|
node = self.nodes[0]
|
|
h = node.help(command='getinfo')
|
|
assert(h.startswith('getinfo\n'))
|
|
|
|
assert_raises_jsonrpc(-8, 'Unknown named parameter', node.help, random='getinfo')
|
|
|
|
h = node.getblockhash(height=0)
|
|
node.getblock(blockhash=h)
|
|
|
|
assert_equal(node.echo(), [])
|
|
assert_equal(node.echo(arg0=0,arg9=9), [0] + [None]*8 + [9])
|
|
assert_equal(node.echo(arg1=1), [None, 1])
|
|
assert_equal(node.echo(arg9=None), [None]*10)
|
|
assert_equal(node.echo(arg0=0,arg3=3,arg9=9), [0] + [None]*2 + [3] + [None]*5 + [9])
|
|
|
|
if __name__ == '__main__':
|
|
NamedArgumentTest().main()
|