From a9b9cce70bd9aea81141c7e02d4be953cafe5ec2 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 3 Feb 2017 00:07:49 -0500 Subject: Fixed optparse parsing of arguments so it works correctly both with embedded quotes and mid-line options. --- tests/test_transcript.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/test_transcript.py') 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 + + -- cgit v1.2.1