diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-01-29 23:42:16 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-01-29 23:42:16 -0500 |
commit | 876a532651d4257ac8c3d80e4c7721ca0af28ec9 (patch) | |
tree | 8d51afd30feeb5e0db3af73a18ea4bfb71ff9e01 /tests/test_transcript.py | |
parent | 16e3cdda9d4c1176246f1e9f9764a789a263814c (diff) | |
download | cmd2-git-876a532651d4257ac8c3d80e4c7721ca0af28ec9.tar.gz |
Added unit test of comment-stripping functionality
Diffstat (limited to 'tests/test_transcript.py')
-rw-r--r-- | tests/test_transcript.py | 15 |
1 files changed, 12 insertions, 3 deletions
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 + + + |