diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-20 20:23:14 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-20 20:23:14 -0400 |
commit | 9ffb1ffa80724b10e5be5563fdefcf67a5abff41 (patch) | |
tree | 4df73432c1c50fc01e87847362cc12986e424686 /tests/test_autocompletion.py | |
parent | d16a20fe14ed02e389ccde99d114e7335740e162 (diff) | |
download | cmd2-git-9ffb1ffa80724b10e5be5563fdefcf67a5abff41.tar.gz |
Made run_cmd return out and err
Diffstat (limited to 'tests/test_autocompletion.py')
-rw-r--r-- | tests/test_autocompletion.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/tests/test_autocompletion.py b/tests/test_autocompletion.py index 2b9e0458..8aeac6b1 100644 --- a/tests/test_autocompletion.py +++ b/tests/test_autocompletion.py @@ -52,12 +52,9 @@ required arguments: optional arguments: -h, --help show this help message and exit''' -def test_help_required_group(cmd2_app, capsys): - run_cmd(cmd2_app, 'suggest -h') - out, err = capsys.readouterr() - out1 = normalize(str(out)) - - out2 = run_cmd(cmd2_app, 'help suggest') +def test_help_required_group(cmd2_app): + out1, err1 = run_cmd(cmd2_app, 'suggest -h') + out2, err2 = run_cmd(cmd2_app, 'help suggest') assert out1 == out2 assert out1[0].startswith('Usage: suggest') @@ -66,12 +63,9 @@ def test_help_required_group(cmd2_app, capsys): assert out1 == normalize(SUGGEST_HELP) -def test_help_required_group_long(cmd2_app, capsys): - run_cmd(cmd2_app, 'media movies add -h') - out, err = capsys.readouterr() - out1 = normalize(str(out)) - - out2 = run_cmd(cmd2_app, 'help media movies add') +def test_help_required_group_long(cmd2_app): + out1, err1 = run_cmd(cmd2_app, 'media movies add -h') + out2, err2 = run_cmd(cmd2_app, 'help media movies add') assert out1 == out2 assert out1[0].startswith('Usage: media movies add') @@ -156,11 +150,9 @@ def test_autocomp_flags_narg_max(cmd2_app): assert first_match is None -def test_autcomp_narg_beyond_max(cmd2_app, capsys): - run_cmd(cmd2_app, 'suggest -t movie -d 3 4 5') - out, err = capsys.readouterr() - - assert 'Error: unrecognized arguments: 5' in err +def test_autcomp_narg_beyond_max(cmd2_app): + out, err = run_cmd(cmd2_app, 'suggest -t movie -d 3 4 5') + assert 'Error: unrecognized arguments: 5' in err[0] def test_autocomp_subcmd_nested(cmd2_app): |