Skip to content

Commit

Permalink
qa: Add tests for getrpcinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Jan 2, 2019
1 parent d0730f5 commit 251a91c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/functional/interface_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
"""Tests some generic aspects of the RPC interface."""

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
from test_framework.util import assert_equal, assert_greater_than_or_equal

class RPCInterfaceTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True

def test_getrpcinfo(self):
self.log.info("Testing getrpcinfo...")

info = self.nodes[0].getrpcinfo()
assert_equal(len(info['active_commands']), 1)

command = info['active_commands'][0]
assert_equal(command['method'], 'getrpcinfo')
assert_greater_than_or_equal(command['duration'], 0)

def test_batch_request(self):
self.log.info("Testing basic JSON-RPC batch request...")

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

def run_test(self):
self.test_getrpcinfo()
self.test_batch_request()


Expand Down

0 comments on commit 251a91c

Please sign in to comment.