From b0c3fa4dd7d762fb812a9cf74e6879dbfba04a50 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 2 Jul 2017 17:45:12 -0400 Subject: Fixed bugs, removed dead code, and added unit tests Fixed a bug where CmdResult named tuple Truthiness wasn't working in Python 2 Removed unused cmd2.History.search() method. Added unit tests for: - History class - cast() function - CmdResult namedtuple --- tests/test_transcript.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index d1363f8e..87640b5e 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -30,6 +30,7 @@ class CmdLineApp(Cmd): # Need to use this older form of invoking super class constructor to support Python 2.x and Python 3.x Cmd.__init__(self, *args, **kwargs) + self.intro = 'This is an intro banner ...' # Configure how arguments are parsed for @options commands set_posix_shlex(False) @@ -224,7 +225,7 @@ def test_optarser_options_with_spaces_in_quotes(_demo_app): def test_commands_at_invocation(): testargs = ["prog", "say hello", "say Gracie", "quit"] - expected = "hello\nGracie\n" + expected = "This is an intro banner ...\nhello\nGracie\n" with mock.patch.object(sys, 'argv', testargs): app = CmdLineApp() app.stdout = StdOut() -- cgit v1.2.1