[Zope-Checkins] CVS: StandaloneZODB/zLOG/tests - testzLog.py:1.5

Jeremy Hylton jeremy@zope.com
Mon, 29 Oct 2001 12:43:50 -0500


Update of /cvs-repository/StandaloneZODB/zLOG/tests
In directory cvs.zope.org:/tmp/cvs-serv18184

Modified Files:
	testzLog.py 
Log Message:
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.



=== StandaloneZODB/zLOG/tests/testzLog.py 1.4 => 1.5 ===
                     summary=None, detail=None, error=None):
         # skip to the beginning of next entry
-        line = f.readline()
-        while line != "------\n":
+        line = f.readline().strip()
+        while line != "------":
             if not line:
                 self.fail("can't find entry in log file")
             line = f.readline()
@@ -67,17 +67,17 @@
             line = f.readline()
             self.assert_(line.find(detail) != -1, "missing detail")
         if error is not None:
-            line = f.readline()
+            line = f.readline().strip()
             self.assert_(line.startswith('Traceback'),
                          "missing traceback")
-            last = "%s: %s\n" % (error[0], error[1])
+            last = "%s: %s" % (error[0], error[1])
             if last.startswith("exceptions."):
                 last = last[len("exceptions."):]
             while 1:
-                line = f.readline()
+                line = f.readline().strip()
                 if not line:
                     self.fail("couldn't find end of traceback")
-                if line == "------\n":
+                if line == "------":
                     self.fail("couldn't find end of traceback")
                 if line == last:
                     break