[Buildbot-commits] buildbot/buildbot/test test_p4poller.py, 1.5, 1.6 test_status.py, 1.39, 1.40 test_web.py, 1.41, 1.42

Brian Warner warner at users.sourceforge.net
Sun Apr 15 01:28:49 UTC 2007


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

Modified Files:
	test_p4poller.py test_status.py test_web.py 
Log Message:
[project @ web-parts: start rearranging web status files]

Original author: warner at lothar.com

Date: 2007-02-27 20:33:22+00:00

Index: test_p4poller.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- test_p4poller.py	28 Feb 2007 06:27:50 -0000	1.5
+++ test_p4poller.py	15 Apr 2007 01:28:47 -0000	1.6
@@ -38,20 +38,20 @@
 """
 
 p4change = {
-    3: change_3_log +
+    '3': change_3_log +
 """Affected files ...
 
 ... //depot/myproject/branch_b/branch_b_file#1 add
 ... //depot/myproject/branch_b/whatbranch#1 branch
 ... //depot/myproject/branch_c/whatbranch#1 branch
 """,
-    2: change_2_log +
+    '2': change_2_log +
 """Affected files ...
 
 ... //depot/myproject/trunk/whatbranch#1 add
 ... //depot/otherproject/trunk/something#1 add
 """,
-    5: change_4_log +
+    '5': change_4_log +
 """Affected files ...
 
 ... //depot/myproject/branch_b/branch_b_file#1 add
@@ -108,14 +108,14 @@
 
     def _testCheck2(self, res):
         self.assertEquals(self.changes, [])
-        self.assertEquals(self.t.last_change, 1)
+        self.assertEquals(self.t.last_change, '1')
 
         # Subsequent times, it returns Change objects for new changes.
         return self.t.checkp4().addCallback(self._testCheck3)
 
     def _testCheck3(self, res):
         self.assertEquals(len(self.changes), 3)
-        self.assertEquals(self.t.last_change, 3)
+        self.assertEquals(self.t.last_change, '3')
         self.assert_(not self.t.working)
 
         # They're supposed to go oldest to newest, so this one must be first.
@@ -170,7 +170,7 @@
     def testFailedDescribe(self):
         """'p4 describe' failure is properly reported"""
         c = dict(p4change)
-        c[3] = 'Perforce client error:\n...'
+        c['3'] = 'Perforce client error:\n...'
         self.t = MockP4Source(p4changes=[first_p4changes, second_p4changes],
                               p4change=c, p4port=None, p4user=None)
         self.t.parent = self
@@ -186,7 +186,7 @@
         self.assert_(isinstance(f, failure.Failure))
         self.failUnlessIn('Perforce client error', str(f))
         self.assert_(not self.t.working)
-        self.assertEquals(self.t.last_change, 2)
+        self.assertEquals(self.t.last_change, '2')
 
     def testAlreadyWorking(self):
         """don't launch a new poll while old is still going"""
@@ -213,4 +213,4 @@
 
     def _testSplitFile(self, res):
         self.assertEquals(len(self.changes), 2)
-        self.assertEquals(self.t.last_change, 5)
+        self.assertEquals(self.t.last_change, '5')

Index: test_status.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- test_status.py	14 Apr 2007 23:41:01 -0000	1.39
+++ test_status.py	15 Apr 2007 01:28:47 -0000	1.40
@@ -135,11 +135,7 @@
         return MyBuild(self.builder, number, results)
 
     def failUnlessIn(self, substring, string):
-        self.failUnless(string.find(substring) != -1,
-                        "didn't see '%s' in '%s'" % (substring, string))
-
-    def getProjectName(self):
-        return "PROJECT"
+        self.failUnless(string.find(substring) != -1)
 
     def getBuildbotURL(self):
         return "BUILDBOT_URL"
@@ -166,7 +162,7 @@
         self.failUnlessIn("To: bob at dev.com, recip2 at example.com, "
                           "recip at example.com\n", t)
         self.failUnlessIn("From: buildbot at example.com\n", t)
-        self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t)
+        self.failUnlessIn("Subject: buildbot success in builder1\n", t)
         self.failUnlessIn("Date: ", t)
         self.failUnlessIn("Build succeeded!\n", t)
         self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t)
@@ -191,7 +187,7 @@
         self.failUnlessIn("To: recip2 at example.com, "
                           "recip at example.com\n", t)
         self.failUnlessIn("From: buildbot at example.com\n", t)
-        self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t)
+        self.failUnlessIn("Subject: buildbot success in builder1\n", t)
         self.failUnlessIn("Build succeeded!\n", t)
         self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t)
 
@@ -292,7 +288,7 @@
         self.failUnlessIn("To: dev3 at dev.com, dev4 at dev.com, "
                           "recip2 at example.com, recip at example.com\n", t)
         self.failUnlessIn("From: buildbot at example.com\n", t)
-        self.failUnlessIn("Subject: buildbot failure in PROJECT on builder1\n", t)
+        self.failUnlessIn("Subject: buildbot failure in builder1\n", t)
         self.failUnlessIn("The Buildbot has detected a new failure", t)
         self.failUnlessIn("BUILD FAILED: snarkleack polarization failed\n", t)
         self.failUnlessEqual(r, ["dev3 at dev.com", "dev4 at dev.com",
@@ -318,7 +314,7 @@
         self.failUnless(len(self.messages) == 1)
         m,r = self.messages.pop()
         t = m.as_string()
-        self.failUnlessIn("Subject: buildbot warnings in PROJECT on builder1\n", t)
+        self.failUnlessIn("Subject: buildbot warnings in builder1\n", t)
         m2 = email.message_from_string(t)
         p = m2.get_payload()
         self.failUnlessEqual(len(p), 3)

Index: test_web.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- test_web.py	27 Feb 2007 23:07:16 -0000	1.41
+++ test_web.py	15 Apr 2007 01:28:47 -0000	1.42
@@ -12,7 +12,6 @@
 
 from buildbot import master, interfaces, sourcestamp
 from buildbot.status import html, builder
-from buildbot.status.web import waterfall
 from buildbot.changes.changes import Change
 from buildbot.process import base
 from buildbot.process.buildstep import BuildStep
@@ -231,7 +230,7 @@
         d.addCallback(self._test_waterfall_3)
         return d
     def _test_waterfall_3(self, icon):
-        expected = open(waterfall.buildbot_icon,"rb").read()
+        expected = open(html.buildbot_icon,"rb").read()
         self.failUnless(icon == expected)
 
         d = client.getPage("http://localhost:%d/changes" % self.port)
@@ -265,7 +264,7 @@
         s = setupBuildStepStatus("test_web.test_urls")
         s.addURL("coverage", "http://coverage.example.org/target")
         s.addURL("icon", "http://coverage.example.org/icon.png")
-        box = waterfall.IBox(s).getBox()
+        box = html.IBox(s).getBox()
         td = box.td()
         e1 = '[<a href="http://coverage.example.org/target" class="BuildStep external">coverage</a>]'
         self.failUnlessSubstring(e1, td)





More information about the Commits mailing list