[Buildbot-commits] buildbot/buildbot/test test_status.py,1.12,1.13

Brian Warner warner at users.sourceforge.net
Thu Nov 11 20:47:17 UTC 2004


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

Modified Files:
	test_status.py 
Log Message:
* buildbot/status/builder.py (LogFile.addEntry): smarter way to do it: one
string merge per chunk. There are now separate .entries and .runEntries
lists: when enumerating over all chunks, make sure to look at both.
* buildbot/test/test_status.py (Log): more tests


Index: test_status.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- test_status.py	11 Nov 2004 19:31:06 -0000	1.12
+++ test_status.py	11 Nov 2004 20:47:14 -0000	1.13
@@ -247,6 +247,9 @@
         l.addStdout("Some text\n")
         l.addStderr("Some error\n")
         l.addStdout("Some more text\n")
+        self.failIf(l.isFinished())
+        l.finish()
+        self.failUnless(l.isFinished())
         self.failUnlessEqual(l.getText(),
                              "Some text\nSome error\nSome more text\n")
         self.failUnlessEqual(l.getTextWithHeaders(),
@@ -260,6 +263,7 @@
         l.addStdout("Some text\n")
         l.addStdout("Some more text\n")
         l.addStdout("more\n")
+        l.finish()
         self.failUnlessEqual(l.getText(),
                              "Some text\nSome more text\nmore\n")
         self.failUnlessEqual(l.getTextWithHeaders(),
@@ -267,6 +271,22 @@
                              "Some text\nSome more text\nmore\n")
         self.failUnlessEqual(len(l.getChunks()), 2)
 
+    def testMerge2(self):
+        l = builder.LogFile(None)
+        l.addHeader("HEADER\n")
+        for i in xrange(1000):
+            l.addStdout("aaaa")
+        for i in xrange(30):
+            l.addStderr("bbbb")
+        for i in xrange(10):
+            l.addStdout("cc")
+        self.failUnlessEqual(l.getText(),
+                             1000*"aaaa" + 30 * "bbbb" + 10 * "cc")
+        l.finish()
+        self.failUnlessEqual(l.getText(),
+                             1000*"aaaa" + 30 * "bbbb" + 10 * "cc")
+        self.failUnlessEqual(len(l.getChunks()), 4)
+
     def testStubify(self):
         l = builder.LogFile(None)
         l.name = "compile"





More information about the Commits mailing list