Merge pull request #6218 from sellout/more-help-fixes

`zcash --help` test improvements
This commit is contained in:
Greg Pfeil 2022-10-24 15:40:36 -06:00 committed by GitHub
commit 9cb63cf5f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -12,7 +12,6 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, zcashd_binary
import subprocess
import tempfile
import time
help_message = """
In order to ensure you are adequately protecting your privacy when using Zcash,
@ -489,9 +488,7 @@ class ShowHelpTest(BitcoinTestFramework):
def show_help(self):
with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stdout:
args = [ zcashd_binary(), "--help" ]
process = subprocess.Popen(args, stdout=log_stdout)
while process.poll() is None:
time.sleep(0.25)
process = subprocess.run(args, stdout=log_stdout)
assert_equal(process.returncode, 0)
log_stdout.seek(0)
stdout = log_stdout.read().decode('utf-8')

View File

@ -443,7 +443,7 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
if expected_msg is None:
assert_msg = "%s should have exited with an error" % (zcashd_binary(),)
else:
assert_msg = "%s should have exited with expected error %s" % (zcashd_binary(), expected_msg)
assert_msg = "%s should have exited with expected error %r" % (zcashd_binary(), expected_msg)
raise AssertionError(assert_msg)
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):