mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Standardize output streams for outputs of commands
This commit is contained in:
parent
0ad0d89fcd
commit
fce6b6af52
@ -36,6 +36,12 @@ logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Note about printing:
|
||||
# We try to print to stdout for results of a command that may be useful to
|
||||
# someone (or another program). Strictly informational text, or errors,
|
||||
# should be printed to stderr.
|
||||
|
||||
|
||||
def run_show_config(args):
|
||||
"""Show the current configuration"""
|
||||
# TODO Proposal: remove the "hidden" configuration. Only show config. If
|
||||
@ -84,7 +90,7 @@ def run_configure(args, skip_if_exists=False):
|
||||
|
||||
# select the correct config defaults based on the backend
|
||||
print('Generating default configuration for backend {}'
|
||||
.format(args.backend))
|
||||
.format(args.backend), file=sys.stderr)
|
||||
conf['database'] = bigchaindb._database_map[args.backend]
|
||||
|
||||
if not args.yes:
|
||||
|
@ -133,8 +133,10 @@ def test_bigchain_export_my_pubkey_when_pubkey_set(capsys, monkeypatch):
|
||||
run_export_my_pubkey(args)
|
||||
out, err = capsys.readouterr()
|
||||
lines = out.splitlines()
|
||||
err_lines = err.splitlines()
|
||||
assert config['keypair']['public'] in lines
|
||||
assert 'Charlie_Bucket' in lines
|
||||
assert 'bigchaindb args = {}'.format(args) in err_lines
|
||||
|
||||
|
||||
def test_bigchain_export_my_pubkey_when_pubkey_not_set(monkeypatch):
|
||||
|
Loading…
x
Reference in New Issue
Block a user