mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Add test for show_config option
This commit is contained in:
parent
88d910f701
commit
61c9268294
@ -1,4 +1,5 @@
|
||||
from argparse import Namespace
|
||||
from pprint import pprint
|
||||
|
||||
import pytest
|
||||
|
||||
@ -37,3 +38,18 @@ def test_bigchain_run_start(mock_run_configure, mock_file_config,
|
||||
from bigchaindb.commands.bigchain import run_start
|
||||
args = Namespace(config=None, yes=True)
|
||||
run_start(args)
|
||||
|
||||
|
||||
# TODO Please beware, that if debugging, the "-s" switch for pytest will
|
||||
# interfere with capsys.
|
||||
# See related issue: https://github.com/pytest-dev/pytest/issues/128
|
||||
def test_bigchain_show_config(capsys, mock_file_config):
|
||||
from bigchaindb import config
|
||||
from bigchaindb.commands.bigchain import run_show_config
|
||||
args = Namespace(config=None)
|
||||
_, _ = capsys.readouterr()
|
||||
run_show_config(args)
|
||||
output_config, _ = capsys.readouterr()
|
||||
pprint(config)
|
||||
expected_outout_config, _ = capsys.readouterr()
|
||||
assert output_config == expected_outout_config
|
||||
|
Loading…
x
Reference in New Issue
Block a user