diff options
author | Jon Atack <jon@atack.com> | 2021-03-27 19:44:11 +0100 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2021-04-19 20:31:02 +0200 |
commit | 655d929836a71af23d2035d2e2e99ad8b8c340c3 (patch) | |
tree | 2df700819b6946221cac2ac05ab0db5d8d14baa5 /test/functional/rpc_misc.py | |
parent | ca01bb8d689f93e1c7669b0ba7a4994c0206dabd (diff) | |
download | bitcoin-655d929836a71af23d2035d2e2e99ad8b8c340c3.tar.xz |
test: add coinstatsindex getindexinfo coverage, improve current tests
Diffstat (limited to 'test/functional/rpc_misc.py')
-rwxr-xr-x | test/functional/rpc_misc.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/test/functional/rpc_misc.py b/test/functional/rpc_misc.py index 1398d1237f..5c26039d04 100755 --- a/test/functional/rpc_misc.py +++ b/test/functional/rpc_misc.py @@ -66,25 +66,22 @@ class RpcMiscTest(BitcoinTestFramework): assert_equal(node.getindexinfo(), {}) # Restart the node with indices and wait for them to sync - self.restart_node(0, ["-txindex", "-blockfilterindex"]) + self.restart_node(0, ["-txindex", "-blockfilterindex", "-coinstatsindex"]) self.wait_until(lambda: all(i["synced"] for i in node.getindexinfo().values())) # Returns a list of all running indices by default + values = {"synced": True, "best_block_height": 200} assert_equal( node.getindexinfo(), { - "txindex": {"synced": True, "best_block_height": 200}, - "basic block filter index": {"synced": True, "best_block_height": 200} + "txindex": values, + "basic block filter index": values, + "coinstatsindex": values, } ) - # Specifying an index by name returns only the status of that index - assert_equal( - node.getindexinfo("txindex"), - { - "txindex": {"synced": True, "best_block_height": 200}, - } - ) + for i in {"txindex", "basic block filter index", "coinstatsindex"}: + assert_equal(node.getindexinfo(i), {i: values}) # Specifying an unknown index name returns an empty result assert_equal(node.getindexinfo("foo"), {}) |