[Buildbot-commits] buildbot/buildbot/test test_changes.py,1.7,1.8
Brian Warner
warner at users.sourceforge.net
Mon Aug 21 03:38:07 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8420/buildbot/test
Modified Files:
test_changes.py
Log Message:
[project @ PBChangeSource.prefix= : fix and simplify, just do a string comparison]
This effectively resolves SF#1217699 and SF#1381867
Original author: warner at lothar.com
Date: 2006-08-21 03:36:38
Index: test_changes.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_changes.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test_changes.py 25 Oct 2005 01:26:10 -0000 1.7
+++ test_changes.py 21 Aug 2006 03:38:05 -0000 1.8
@@ -18,6 +18,9 @@
d3 = {'files': ["Project/baz.c", "OtherProject/bloo.c"],
'who': "alice",
'comments': "mixed changes"}
+d4 = {'files': ["trunk/baz.c", "branches/foobranch/foo.c", "trunk/bar.c"],
+ 'who': "alice",
+ 'comments': "mixed changes"}
class TestChangePerspective(unittest.TestCase):
@@ -38,7 +41,7 @@
self.failUnlessEqual(c1.who, "marvin")
def testPrefix(self):
- p = pb.ChangePerspective(self, "Project")
+ p = pb.ChangePerspective(self, "Project/")
p.perspective_addChange(d1)
self.failUnlessEqual(len(self.changes), 1)
@@ -58,6 +61,42 @@
self.failUnlessEqual(c3.comments, "mixed changes")
self.failUnlessEqual(c3.who, "alice")
+ def testPrefix2(self):
+ p = pb.ChangePerspective(self, "Project/bar/")
+
+ p.perspective_addChange(d1)
+ self.failUnlessEqual(len(self.changes), 1)
+ c1 = self.changes[-1]
+ self.failUnlessEqual(c1.files, ["boo.c"])
+ self.failUnlessEqual(c1.comments, "Some changes in Project")
+ self.failUnlessEqual(c1.who, "marvin")
+
+ p.perspective_addChange(d2) # should be ignored
+ self.failUnlessEqual(len(self.changes), 1)
+
+ p.perspective_addChange(d3) # should ignore this too
+ self.failUnlessEqual(len(self.changes), 1)
+
+ def testPrefix3(self):
+ p = pb.ChangePerspective(self, "trunk/")
+
+ p.perspective_addChange(d4)
+ self.failUnlessEqual(len(self.changes), 1)
+ c1 = self.changes[-1]
+ self.failUnlessEqual(c1.files, ["baz.c", "bar.c"])
+ self.failUnlessEqual(c1.comments, "mixed changes")
+
+ def testPrefix4(self):
+ p = pb.ChangePerspective(self, "branches/foobranch/")
+
+ p.perspective_addChange(d4)
+ self.failUnlessEqual(len(self.changes), 1)
+ c1 = self.changes[-1]
+ self.failUnlessEqual(c1.files, ["foo.c"])
+ self.failUnlessEqual(c1.comments, "mixed changes")
+
+
+
config_empty = """
BuildmasterConfig = c = {}
c['bots'] = []
More information about the Commits
mailing list