Skip to content

Commit 99954f9

Browse files
stratospher0xB10C
authored andcommitted
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 0d01f6f commit 99954f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/rpc_net.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ def test_addpeeraddress(self):
324324
self.restart_node(1, ["-checkaddrman=1", "-test=addrman"], clear_addrman=True)
325325
node = self.nodes[1]
326326

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

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

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

0 commit comments

Comments
 (0)