From 141d95194b30d959f6c21f4546100551c442b13d Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Mon, 15 Jan 2018 01:34:50 -0500 Subject: Made a couple cleanup changes 1) cmd2 no longer imports make_option from optparse - test files and examples now import this directly - this helps emphasize that this old optparse methodology of adding options to commands is deprecated 2) All argparsers have been given custom names instead of just "argparser" - this helps with readability and maintainability, especially with IDE renaming and such --- tests/test_transcript.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index e572e919..0daad18a 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -17,9 +17,10 @@ import six # Used for sm.input: raw_input() for Python 2 or input() for Python 3 import six.moves as sm -from cmd2 import (Cmd, make_option, options, Cmd2TestCase, set_use_arg_list, +from cmd2 import (Cmd, options, Cmd2TestCase, set_use_arg_list, set_posix_shlex, set_strip_quotes) from conftest import run_cmd, StdOut, normalize +from optparse import make_option class CmdLineApp(Cmd): @@ -27,7 +28,7 @@ class CmdLineApp(Cmd): MUMBLES = ['like', '...', 'um', 'er', 'hmmm', 'ahh'] MUMBLE_FIRST = ['so', 'like', 'well'] MUMBLE_LAST = ['right?'] - + def __init__(self, *args, **kwargs): self.abbrev = True self.multilineCommands = ['orate'] @@ -332,7 +333,7 @@ def test_transcript(request, capsys, filename, feedback_to_output): ]) def test_parse_transcript_expected(expected, transformed): app = CmdLineApp() - + class TestMyAppCase(Cmd2TestCase): cmdapp = app -- cgit v1.2.1