Skip to content

Commit 09c849e

Browse files
committed
test: fix test to ensure hidden RPC is present in detailed help
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().
1 parent a85e5a7 commit 09c849e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/rpc_net.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ def test_addpeeraddress(self):
322322
self.restart_node(1, ["-checkaddrman=1", "-test=addrman"])
323323
node = self.nodes[1]
324324

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

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

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

0 commit comments

Comments
 (0)