Skip to content

Commit 251a91c

Browse files
committed
qa: Add tests for getrpcinfo
1 parent d0730f5 commit 251a91c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/functional/interface_rpc.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,23 @@
55
"""Tests some generic aspects of the RPC interface."""
66

77
from test_framework.test_framework import BitcoinTestFramework
8-
from test_framework.util import assert_equal
8+
from test_framework.util import assert_equal, assert_greater_than_or_equal
99

1010
class RPCInterfaceTest(BitcoinTestFramework):
1111
def set_test_params(self):
1212
self.num_nodes = 1
1313
self.setup_clean_chain = True
1414

15+
def test_getrpcinfo(self):
16+
self.log.info("Testing getrpcinfo...")
17+
18+
info = self.nodes[0].getrpcinfo()
19+
assert_equal(len(info['active_commands']), 1)
20+
21+
command = info['active_commands'][0]
22+
assert_equal(command['method'], 'getrpcinfo')
23+
assert_greater_than_or_equal(command['duration'], 0)
24+
1525
def test_batch_request(self):
1626
self.log.info("Testing basic JSON-RPC batch request...")
1727

@@ -39,6 +49,7 @@ def test_batch_request(self):
3949
assert result_by_id[3]['result'] is not None
4050

4151
def run_test(self):
52+
self.test_getrpcinfo()
4253
self.test_batch_request()
4354

4455

0 commit comments

Comments
 (0)