diff --git a/tests/test_commands.py b/tests/test_commands.py index 4cfc0db8..6cc542d4 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -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