(self, args, error=None)
| 25 | super().setup_nodes() |
| 26 | |
| 27 | def test_cli(self, args, error=None): |
| 28 | # Intentionally set wrong RPC password so only IPC not HTTP connections work |
| 29 | args = [self.binary_paths.bitcoincli, f"-datadir={self.nodes[0].datadir_path}", "-rpcpassword=wrong"] + args + ["echo", "foo"] |
| 30 | result = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) |
| 31 | if error is None: |
| 32 | assert_equal(result.stdout, '[\n "foo"\n]\n') |
| 33 | else: |
| 34 | assert result.stdout.startswith(error), f"Output didn't start with the expected error {error!r}:\n{result.stdout}" |
| 35 | assert_equal(result.stderr, None) |
| 36 | assert_equal(result.returncode, 0 if error is None else 1) |
| 37 | |
| 38 | def run_test(self): |
| 39 | node = self.nodes[0] |
no test coverage detected