diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-01-02 12:46:39 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-01-02 12:47:32 +0000 |
commit | 251a91c1bf245b3674c2612149382a0f1e18dc98 (patch) | |
tree | f18a892fc5fe33f0fb4f0c289894732190eb8459 /test/functional/interface_rpc.py | |
parent | d0730f5ce475e5a84da7c61fe79bcd6ed24d693e (diff) |
qa: Add tests for getrpcinfo
Diffstat (limited to 'test/functional/interface_rpc.py')
-rwxr-xr-x | test/functional/interface_rpc.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/functional/interface_rpc.py b/test/functional/interface_rpc.py index e3d7b0655d..b6955d4492 100755 --- a/test/functional/interface_rpc.py +++ b/test/functional/interface_rpc.py @@ -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...") @@ -39,6 +49,7 @@ class RPCInterfaceTest(BitcoinTestFramework): assert result_by_id[3]['result'] is not None def run_test(self): + self.test_getrpcinfo() self.test_batch_request() |