Skip to content

Commit d596dba

Browse files
committed
test: assert logging categories are sorted in rpc and help
1 parent 17bbff3 commit d596dba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/functional/rpc_misc.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def run_test(self):
5454

5555
assert_raises_rpc_error(-8, "unknown mode foobar", node.getmemoryinfo, mode="foobar")
5656

57-
self.log.info("test logging rpc")
57+
self.log.info("test logging rpc and help")
5858

5959
# Test logging RPC returns the expected number of logging categories.
6060
assert_equal(len(node.logging()), 24)
@@ -66,6 +66,15 @@ def run_test(self):
6666
node.logging(include=['qt'])
6767
assert_equal(node.logging()['qt'], True)
6868

69+
# Test logging RPC returns the logging categories in alphabetical order.
70+
sorted_logging_categories = sorted(node.logging())
71+
assert_equal(list(node.logging()), sorted_logging_categories)
72+
73+
# Test logging help returns the logging categories string in alphabetical order.
74+
categories = ', '.join(sorted_logging_categories)
75+
logging_help = self.nodes[0].help('logging')
76+
assert f"valid logging categories are: {categories}" in logging_help
77+
6978
self.log.info("test echoipc (testing spawned process in multiprocess build)")
7079
assert_equal(node.echoipc("hello"), "hello")
7180

0 commit comments

Comments
 (0)