From 09c849e2f544934b121f5fdf62cb974b67b6b962 Mon Sep 17 00:00:00 2001 From: stratospher <44024636+stratospher@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:58:18 +0530 Subject: [PATCH] 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(). --- test/functional/rpc_net.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index 265d9d959ae4b..957280cf6d456 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -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}) @@ -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"""