(self)
| 86 | assert argname == 'dummy', ('WARNING: conversion mismatch for argument named %s (%s)' % (argname, list(zip(all_methods_by_argname[argname], converts_by_argname[argname])))) |
| 87 | |
| 88 | def test_categories(self): |
| 89 | node = self.nodes[0] |
| 90 | |
| 91 | # wrong argument count |
| 92 | assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar') |
| 93 | |
| 94 | # invalid argument |
| 95 | assert_raises_rpc_error(-1, 'JSON value is not a string as expected', node.help, 0) |
| 96 | |
| 97 | # help of unknown command |
| 98 | assert_equal(node.help('foo'), 'help: unknown command: foo') |
| 99 | |
| 100 | # command titles |
| 101 | titles = [line[3:-3] for line in node.help().splitlines() if line.startswith('==')] |
| 102 | |
| 103 | components = ['Blockchain', 'Control', 'Generating', 'Mining', 'Network', 'Rawtransactions', 'Util'] |
| 104 | |
| 105 | if self.is_wallet_compiled(): |
| 106 | components.append('Wallet') |
| 107 | |
| 108 | if self.is_external_signer_compiled(): |
| 109 | components.append('Signer') |
| 110 | |
| 111 | if self.is_zmq_compiled(): |
| 112 | components.append('Zmq') |
| 113 | |
| 114 | assert_equal(titles, sorted(components)) |
| 115 | |
| 116 | def dump_help(self): |
| 117 | dump_dir = os.path.join(self.options.tmpdir, 'rpc_help_dump') |
no test coverage detected