File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 5
5
"""Tests some generic aspects of the RPC interface."""
6
6
7
7
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
9
9
10
10
class RPCInterfaceTest (BitcoinTestFramework ):
11
11
def set_test_params (self ):
12
12
self .num_nodes = 1
13
13
self .setup_clean_chain = True
14
14
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
+
15
25
def test_batch_request (self ):
16
26
self .log .info ("Testing basic JSON-RPC batch request..." )
17
27
@@ -39,6 +49,7 @@ def test_batch_request(self):
39
49
assert result_by_id [3 ]['result' ] is not None
40
50
41
51
def run_test (self ):
52
+ self .test_getrpcinfo ()
42
53
self .test_batch_request ()
43
54
44
55
You can’t perform that action at this time.
0 commit comments