From 876a532651d4257ac8c3d80e4c7721ca0af28ec9 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 29 Jan 2017 23:42:16 -0500 Subject: Added unit test of comment-stripping functionality --- tests/test_transcript.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 69647148..a05e4017 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -137,6 +137,11 @@ now: ---> assert out == expected +class TestMyAppCase(Cmd2TestCase): + CmdApp = CmdLineApp + CmdApp.testfiles = ['tests/transcript.txt'] + + def test_optparser(_cmdline_app, capsys): run_cmd(_cmdline_app, 'say -h') out, err = capsys.readouterr() @@ -170,6 +175,10 @@ Options: assert _normalize(out) == expected -class TestMyAppCase(Cmd2TestCase): - CmdApp = CmdLineApp - CmdApp.testfiles = ['tests/transcript.txt'] +def test_comment_stripping(_cmdline_app): + out = run_cmd(_cmdline_app, 'speak it was /* not */ delicious! # Yuck!') + expected = _normalize("""it was delicious!""") + assert out == expected + + + -- cgit v1.2.1