[Buildbot-commits] buildbot/buildbot/test test_web.py,1.15,1.16 test_status.py,1.17,1.18

Brian Warner warner at users.sourceforge.net
Mon May 16 00:16:31 UTC 2005


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

Modified Files:
	test_web.py test_status.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-175
Creator:  Brian Warner <warner at monolith.lothar.com>

fix HTMLLog to match new LogFile behavior

	* buildbot/status/builder.py (HTMLLogFile): make this behave like
	the new LogFile class, so upgrading works properly
	* buildbot/test/test_web.py (WebTest.test_logfile): validate HTML
	logs too
	* buildbot/test/test_status.py (Log.testAdd): validate hasContents
	(Log.testUpgrade): same


Index: test_status.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- test_status.py	15 May 2005 23:43:57 -0000	1.17
+++ test_status.py	16 May 2005 00:16:28 -0000	1.18
@@ -367,6 +367,10 @@
                              "Some text\nSome error\nSome more text\n")
         self.failUnlessEqual(len(list(l.getChunks())), 4)
 
+        self.failUnless(l.hasContents())
+        os.unlink(l.getFilename())
+        self.failIf(l.hasContents())
+
     def testMerge1(self):
         l = MyLog(self.basedir, "merge1")
         l.addHeader("HEADER\n")
@@ -451,6 +455,7 @@
         l.addStdout("Some more text\n")
         l.addStdout("more\n")
         l.finish()
+        self.failUnless(l.hasContents())
         # now doctor it to look like a 0.6.4-era non-upgraded logfile
         l.entries = list(l.getChunks())
         del l.filename
@@ -471,6 +476,7 @@
                              "Some text\nSome more text\nmore\n")
         self.failUnlessEqual(len(list(l.getChunks())), 2)
         self.failIf(l.entries)
+        self.failUnless(l.hasContents())
 
     def testSubscribe(self):
         l1 = MyLog(self.basedir, "subscribe1")

Index: test_web.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- test_web.py	14 May 2005 05:31:30 -0000	1.15
+++ test_web.py	16 May 2005 00:16:28 -0000	1.16
@@ -238,9 +238,13 @@
         bs.addStep(step1)
         bs.buildStarted(build1)
         step1.step_status.stepStarted()
-        loog = step1.addLog("output")
-        loog.addStdout("some stdout\n")
-        loog.finish()
+
+        log1 = step1.addLog("output")
+        log1.addStdout("some stdout\n")
+        log1.finish()
+
+        log2 = step1.addHTMLLog("error", "<html>ouch</html>")
+
         step1.step_status.stepFinished(builder.SUCCESS)
         bs.buildFinished()
 
@@ -255,3 +259,9 @@
         d = client.getPage(logurl + "/text")
         logtext = dr(d, 5)
         self.failUnlessEqual(logtext, "some stdout\n")
+
+        logurl = "http://localhost:%d/builder1/builds/0/setup/1" % port
+        d = client.getPage(logurl)
+        logbody = dr(d, 5)
+        self.failUnlessEqual(logbody, "<html>ouch</html>")
+





More information about the Commits mailing list