Skip to content

Commit

Permalink
test: fix test to ensure hidden RPC is present in detailed help
Browse files Browse the repository at this point in the history
current check to make sure that detailed help for hidden RPC
is displayed won't work because the assertion isn't sufficient.
Even if unknown RPCs are passed, RPC names would still be present
in node.help().
  • Loading branch information
stratospher committed Mar 19, 2024
1 parent a85e5a7 commit 09c849e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/functional/rpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ def test_addpeeraddress(self):
self.restart_node(1, ["-checkaddrman=1", "-test=addrman"])
node = self.nodes[1]

self.log.debug("Test that addpeerinfo is a hidden RPC")
self.log.debug("Test that addpeeraddress is a hidden RPC")
# It is hidden from general help, but its detailed help may be called directly.
assert "addpeerinfo" not in node.help()
assert "addpeerinfo" in node.help("addpeerinfo")
assert "addpeeraddress" not in node.help()
assert "unknown command: addpeeraddress" not in node.help("addpeeraddress")

self.log.debug("Test that adding an empty address fails")
assert_equal(node.addpeeraddress(address="", port=8333), {"success": False})
Expand Down Expand Up @@ -426,7 +426,7 @@ def test_getrawaddrman(self):
self.log.debug("Test that getrawaddrman is a hidden RPC")
# It is hidden from general help, but its detailed help may be called directly.
assert "getrawaddrman" not in node.help()
assert "getrawaddrman" in node.help("getrawaddrman")
assert "unknown command: getrawaddrman" not in node.help("getrawaddrman")

def check_addr_information(result, expected):
"""Utility to compare a getrawaddrman result entry with an expected entry"""
Expand Down

0 comments on commit 09c849e

Please sign in to comment.