File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 77from test_framework .test_framework import BitcoinTestFramework
88from test_framework .util import assert_equal , assert_raises_rpc_error
99
10+ import os
11+
1012
1113class HelpRpcTest (BitcoinTestFramework ):
1214 def set_test_params (self ):
1315 self .num_nodes = 1
1416
1517 def run_test (self ):
18+ self .test_categories ()
19+ self .dump_help ()
20+
21+ def test_categories (self ):
1622 node = self .nodes [0 ]
1723
1824 # wrong argument count
@@ -37,6 +43,15 @@ def run_test(self):
3743
3844 assert_equal (titles , components )
3945
46+ def dump_help (self ):
47+ dump_dir = os .path .join (self .options .tmpdir , 'rpc_help_dump' )
48+ os .mkdir (dump_dir )
49+ calls = [line .split (' ' , 1 )[0 ] for line in self .nodes [0 ].help ().splitlines () if line and not line .startswith ('==' )]
50+ for call in calls :
51+ with open (os .path .join (dump_dir , call ), 'w' , encoding = 'utf-8' ) as f :
52+ # Make sure the node can generate the help at runtime without crashing
53+ f .write (self .nodes [0 ].help (call ))
54+
4055
4156if __name__ == '__main__' :
4257 HelpRpcTest ().main ()
You can’t perform that action at this time.
0 commit comments