diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-02-03 00:07:49 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-02-03 00:07:49 -0500 |
commit | a9b9cce70bd9aea81141c7e02d4be953cafe5ec2 (patch) | |
tree | 799889b05a74bd50ebe6e740caa4eea2787812e9 /tests/test_transcript.py | |
parent | 1a6dd328d834a8475acceb9211ec4f24fecc9af7 (diff) | |
download | cmd2-git-a9b9cce70bd9aea81141c7e02d4be953cafe5ec2.tar.gz |
Fixed optparse parsing of arguments so it works correctly both with embedded quotes and mid-line options.
Diffstat (limited to 'tests/test_transcript.py')
-rw-r--r-- | tests/test_transcript.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 01451b95..aefd0068 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -176,10 +176,16 @@ Options: assert _normalize(str(out)) == expected -def test_comment_stripping(_cmdline_app): +def test_comment_stripping(_cmdline_app, capsys): out = run_cmd(_cmdline_app, 'speak it was /* not */ delicious! # Yuck!') expected = _normalize("""it was delicious!""") assert out == expected +def test_optarser_correct_args_with_quotes_and_midline_options(_cmdline_app, capsys): + out = run_cmd(_cmdline_app, "speak 'This is a' -s test of the emergency broadcast system!") + expected = _normalize("""THIS IS A TEST OF THE EMERGENCY BROADCAST SYSTEM!""") + assert out == expected + + |