From d717ea7966574dfec85bcc057f7abe5579c5c121 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Thu, 29 Jun 2017 12:47:11 -0400 Subject: Refactored to replace custom StubbornDict with collections.OrderedDict The self.settable object is now an OrderedDict instead of a custom StubbornDict. --- tests/test_transcript.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/test_transcript.py') diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 4b6f4c99..a31ebd17 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -20,14 +20,16 @@ from conftest import run_cmd, StdOut, normalize class CmdLineApp(Cmd): - multilineCommands = ['orate'] - maxrepeats = 3 - redirector = '->' - def __init__(self, *args, **kwargs): + self.multilineCommands = ['orate'] + self.maxrepeats = 3 + self.redirector = '->' + + # Add stuff to settable and/or shortcuts before calling base class initializer + self.settable['maxrepeats'] = 'Max number of `--repeat`s allowed' + # 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.settable.append('maxrepeats Max number of `--repeat`s allowed') # Configure how arguments are parsed for @options commands set_posix_shlex(False) -- cgit v1.2.1