[Buildbot-commits] buildbot/buildbot/test test_status.py, 1.33, 1.34

Brian Warner warner at users.sourceforge.net
Fri Sep 15 14:48:46 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21118/buildbot/test

Modified Files:
	test_status.py 
Log Message:
[project @ add IStatusLog.readlines()]

Original author: warner at lothar.com
Date: 2006-09-08 21:42:21

Index: test_status.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- test_status.py	15 Sep 2006 14:47:41 -0000	1.33
+++ test_status.py	15 Sep 2006 14:48:44 -0000	1.34
@@ -488,6 +488,29 @@
         l.finish()
         self.failUnlessEqual(l.getText(), 160*"a")
 
+    def testReadlines(self):
+        l = MyLog(self.basedir, "chunks")
+        l.addHeader("HEADER\n") # should be ignored
+        l.addStdout("Some text\n")
+        l.addStdout("Some More Text\nAnd Some More\n")
+        l.addStderr("Some Stderr\n")
+        l.addStdout("Last line\n")
+        l.finish()
+        alllines = list(l.readlines())
+        self.failUnlessEqual(len(alllines), 5)
+        self.failUnlessEqual(alllines[0], "Some text\n")
+        self.failUnlessEqual(alllines[3], "Some Stderr\n")
+        self.failUnlessEqual(alllines[4], "Last line\n")
+        lines = l.readlines()
+        if False: # TODO: l.readlines() is not yet an iterator
+            # verify that it really is an iterator
+            line0 = lines.next()
+            self.failUnlessEqual(line0, "Some text\n")
+            line1 = lines.next()
+            line2 = lines.next()
+            self.failUnlessEqual(line2, "And Some More\n")
+
+
     def testChunks(self):
         l = MyLog(self.basedir, "chunks")
         c1 = l.getChunks()





More information about the Commits mailing list