Skip to content

Commit c6ec435

Browse files
committed
[tests] Add bitcoin_cli.py test script
1 parent b23549f commit c6ec435

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

test/functional/bitcoin_cli.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2017 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
"""Test bitcoin-cli"""
6+
from test_framework.test_framework import BitcoinTestFramework
7+
from test_framework.util import assert_equal
8+
9+
class TestBitcoinCli(BitcoinTestFramework):
10+
11+
def __init__(self):
12+
super().__init__()
13+
self.setup_clean_chain = True
14+
self.num_nodes = 1
15+
16+
def run_test(self):
17+
"""Main test logic"""
18+
19+
self.log.info("Compare responses from getinfo RPC and `bitcoin-cli getinfo`")
20+
cli_get_info = self.nodes[0].cli.getinfo()
21+
rpc_get_info = self.nodes[0].getinfo()
22+
23+
assert_equal(cli_get_info, rpc_get_info)
24+
25+
if __name__ == '__main__':
26+
TestBitcoinCli().main()

test/functional/test_runner.py

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
# vv Tests less than 30s vv
8282
'keypool-topup.py',
8383
'zmq_test.py',
84+
'bitcoin_cli.py',
8485
'mempool_resurrect_test.py',
8586
'txn_doublespend.py --mineblock',
8687
'txn_clone.py',

0 commit comments

Comments
 (0)