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

Brian Warner warner at users.sourceforge.net
Tue Apr 17 06:38:53 UTC 2007


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

Modified Files:
	test_p4poller.py test_status.py test_web.py 
Log Message:
[project @ update CREDITS]

Original author: warner at lothar.com

Date: 2007-04-17 06:38:12+00:00

Index: test_p4poller.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- test_p4poller.py	15 Apr 2007 01:28:47 -0000	1.6
+++ test_p4poller.py	17 Apr 2007 06:38:51 -0000	1.7
@@ -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.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- test_status.py	15 Apr 2007 01:28:47 -0000	1.40
+++ test_status.py	17 Apr 2007 06:38:51 -0000	1.41
@@ -135,7 +135,11 @@
         return MyBuild(self.builder, number, results)
 
     def failUnlessIn(self, substring, string):
-        self.failUnless(string.find(substring) != -1)
+        self.failUnless(string.find(substring) != -1,
+                        "didn't see '%s' in '%s'" % (substring, string))
+
+    def getProjectName(self):
+        return "PROJECT"
 
     def getBuildbotURL(self):
         return "BUILDBOT_URL"
@@ -162,7 +166,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 builder1\n", t)
+        self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t)
         self.failUnlessIn("Date: ", t)
         self.failUnlessIn("Build succeeded!\n", t)
         self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t)
@@ -187,7 +191,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 builder1\n", t)
+        self.failUnlessIn("Subject: buildbot success in PROJECT on builder1\n", t)
         self.failUnlessIn("Build succeeded!\n", t)
         self.failUnlessIn("Buildbot URL: BUILDBOT_URL\n", t)
 
@@ -288,7 +292,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 builder1\n", t)
+        self.failUnlessIn("Subject: buildbot failure in PROJECT on 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",
@@ -314,7 +318,7 @@
         self.failUnless(len(self.messages) == 1)
         m,r = self.messages.pop()
         t = m.as_string()
-        self.failUnlessIn("Subject: buildbot warnings in builder1\n", t)
+        self.failUnlessIn("Subject: buildbot warnings in PROJECT on 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.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- test_web.py	15 Apr 2007 01:28:47 -0000	1.42
+++ test_web.py	17 Apr 2007 06:38:51 -0000	1.43
@@ -12,6 +12,7 @@
 
 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
@@ -230,7 +231,7 @@
         d.addCallback(self._test_waterfall_3)
         return d
     def _test_waterfall_3(self, icon):
-        expected = open(html.buildbot_icon,"rb").read()
+        expected = open(waterfall.buildbot_icon,"rb").read()
         self.failUnless(icon == expected)
 
         d = client.getPage("http://localhost:%d/changes" % self.port)
@@ -264,7 +265,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 = html.IBox(s).getBox()
+        box = waterfall.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