Merge pull request #6218 from sellout/more-help-fixes
`zcash --help` test improvements
This commit is contained in:
commit
9cb63cf5f7
|
@ -12,7 +12,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_equal, assert_true, zcashd_binary
|
from test_framework.util import assert_equal, assert_true, zcashd_binary
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
|
||||||
|
|
||||||
help_message = """
|
help_message = """
|
||||||
In order to ensure you are adequately protecting your privacy when using Zcash,
|
In order to ensure you are adequately protecting your privacy when using Zcash,
|
||||||
|
@ -489,9 +488,7 @@ class ShowHelpTest(BitcoinTestFramework):
|
||||||
def show_help(self):
|
def show_help(self):
|
||||||
with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stdout:
|
with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stdout:
|
||||||
args = [ zcashd_binary(), "--help" ]
|
args = [ zcashd_binary(), "--help" ]
|
||||||
process = subprocess.Popen(args, stdout=log_stdout)
|
process = subprocess.run(args, stdout=log_stdout)
|
||||||
while process.poll() is None:
|
|
||||||
time.sleep(0.25)
|
|
||||||
assert_equal(process.returncode, 0)
|
assert_equal(process.returncode, 0)
|
||||||
log_stdout.seek(0)
|
log_stdout.seek(0)
|
||||||
stdout = log_stdout.read().decode('utf-8')
|
stdout = log_stdout.read().decode('utf-8')
|
||||||
|
|
|
@ -443,7 +443,7 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
|
||||||
if expected_msg is None:
|
if expected_msg is None:
|
||||||
assert_msg = "%s should have exited with an error" % (zcashd_binary(),)
|
assert_msg = "%s should have exited with an error" % (zcashd_binary(),)
|
||||||
else:
|
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)
|
raise AssertionError(assert_msg)
|
||||||
|
|
||||||
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):
|
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):
|
||||||
|
|
Loading…
Reference in New Issue