File tree 1 file changed +15
-0
lines changed 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 7
7
from test_framework .test_framework import BitcoinTestFramework
8
8
from test_framework .util import assert_equal , assert_raises_rpc_error
9
9
10
+ import os
11
+
10
12
11
13
class HelpRpcTest (BitcoinTestFramework ):
12
14
def set_test_params (self ):
13
15
self .num_nodes = 1
14
16
15
17
def run_test (self ):
18
+ self .test_categories ()
19
+ self .dump_help ()
20
+
21
+ def test_categories (self ):
16
22
node = self .nodes [0 ]
17
23
18
24
# wrong argument count
@@ -37,6 +43,15 @@ def run_test(self):
37
43
38
44
assert_equal (titles , components )
39
45
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
+
40
55
41
56
if __name__ == '__main__' :
42
57
HelpRpcTest ().main ()
You can’t perform that action at this time.
0 commit comments