Commit 0b70a63b authored by Jeremy Hylton's avatar Jeremy Hylton

Fix test to succeed on Windows.

Don't test for explicit end-of-line markers, since they vary across
platforms.  Instead, strip() the line read and test for the actual content.
parent ebdf1e36
...@@ -46,8 +46,8 @@ class StupidLogTest(unittest.TestCase): ...@@ -46,8 +46,8 @@ class StupidLogTest(unittest.TestCase):
def verifyEntry(self, f, time=None, subsys=None, severity=None, def verifyEntry(self, f, time=None, subsys=None, severity=None,
summary=None, detail=None, error=None): summary=None, detail=None, error=None):
# skip to the beginning of next entry # skip to the beginning of next entry
line = f.readline() line = f.readline().strip()
while line != "------\n": while line != "------":
if not line: if not line:
self.fail("can't find entry in log file") self.fail("can't find entry in log file")
line = f.readline() line = f.readline()
...@@ -67,17 +67,17 @@ class StupidLogTest(unittest.TestCase): ...@@ -67,17 +67,17 @@ class StupidLogTest(unittest.TestCase):
line = f.readline() line = f.readline()
self.assert_(line.find(detail) != -1, "missing detail") self.assert_(line.find(detail) != -1, "missing detail")
if error is not None: if error is not None:
line = f.readline() line = f.readline().strip()
self.assert_(line.startswith('Traceback'), self.assert_(line.startswith('Traceback'),
"missing traceback") "missing traceback")
last = "%s: %s\n" % (error[0], error[1]) last = "%s: %s" % (error[0], error[1])
if last.startswith("exceptions."): if last.startswith("exceptions."):
last = last[len("exceptions."):] last = last[len("exceptions."):]
while 1: while 1:
line = f.readline() line = f.readline().strip()
if not line: if not line:
self.fail("couldn't find end of traceback") self.fail("couldn't find end of traceback")
if line == "------\n": if line == "------":
self.fail("couldn't find end of traceback") self.fail("couldn't find end of traceback")
if line == last: if line == last:
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment