diff options
| author | Catherine Devlin <catherine.devlin@gmail.com> | 2008-10-29 10:53:11 -0400 |
|---|---|---|
| committer | Catherine Devlin <catherine.devlin@gmail.com> | 2008-10-29 10:53:11 -0400 |
| commit | bda7b7c6949e74f1b7a219f167157c4c38ce5783 (patch) | |
| tree | 93c9b17025452c2508e918b2d0a13b1f3184d29a | |
| parent | 879b0b9fda15275cfeedec0723244109ae4f3fdb (diff) | |
| download | cmd2-git-0.4.1.tar.gz | |
now works Python 2.4 to Python 2.60.4.1
| -rwxr-xr-x | cmd2.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -745,7 +745,7 @@ class TranscriptReader(object): return result
except StopIteration:
return self.transcript[self.bookmark:]
-
+
class Cmd2TestCase(unittest.TestCase):
'''Subclass this, setting CmdApp and transcriptFileName, to make a unittest.TestCase class
that will execute the commands in transcriptFileName and expect the results shown.
@@ -769,11 +769,11 @@ class Cmd2TestCase(unittest.TestCase): (self.transcriptFileName, lineNum, cmdInput, expected, result))
def stripByLine(self, s):
bareprompt = self.cmdapp.continuationPrompt.strip()
- lines = (line.rstrip() for line in s.splitlines())
- lines = ( line.replace(bareprompt, '', 1)
- if line.startswith(bareprompt)
- else line
- for line in lines)
+ lines = []
+ for line in s.splitlines():
+ line = line.rstrip()
+ if line.startswith(bareprompt):
+ line = line.replace(bareprompt, '', 1)
return '\n'.join(lines).strip()
def tearDown(self):
if self.CmdApp:
|
