comparison cmd2.py @ 303:c3b9b2256dd6

tweaking transcript test newlines
author catherine@dellzilla
date Wed, 27 Jan 2010 10:05:11 -0500
parents b4b22dd087dc
children 8c96f829ba1b
comparison
equal deleted inserted replaced
302:b4b22dd087dc 303:c3b9b2256dd6
1235 expectationParser = regexPattern | notRegexPattern 1235 expectationParser = regexPattern | notRegexPattern
1236 endStrippingRegex = re.compile(r'[ \t]*\n') 1236 endStrippingRegex = re.compile(r'[ \t]*\n')
1237 def _test_transcript(self, fname, transcript): 1237 def _test_transcript(self, fname, transcript):
1238 lineNum = 0 1238 lineNum = 0
1239 try: 1239 try:
1240 line = transcript.next() 1240 line = transcript.next().strip()
1241 while True: 1241 while True:
1242 while not line.startswith(self.cmdapp.prompt): 1242 while not line.startswith(self.cmdapp.prompt):
1243 line = transcript.next() 1243 line = transcript.next().strip()
1244 command = [line[len(self.cmdapp.prompt):]] 1244 command = [line[len(self.cmdapp.prompt):]]
1245 line = transcript.next() 1245 line = transcript.next().strip()
1246 while line.startswith(self.cmdapp.continuation_prompt): 1246 while line.startswith(self.cmdapp.continuation_prompt):
1247 command.append(line[len(self.cmdapp.continuation_prompt):]) 1247 command.append(line[len(self.cmdapp.continuation_prompt):])
1248 line = transcript.next() 1248 line = transcript.next().strip()
1249 command = ''.join(command) 1249 command = ''.join(command)
1250 self.cmdapp.onecmd(command) 1250 self.cmdapp.onecmd(command)
1251 result = self.outputTrap.read().strip() 1251 result = self.outputTrap.read().strip()
1252 if line.startswith(self.cmdapp.prompt): 1252 if line.startswith(self.cmdapp.prompt):
1253 message = '\nFile %s, line %d\nCommand was:\n%s\nExpected: (nothing)\nGot:\n%s\n'%\ 1253 message = '\nFile %s, line %d\nCommand was:\n%s\nExpected: (nothing)\nGot:\n%s\n'%\