[Buildbot-commits] buildbot/buildbot/test test_bonsaipoller.py, 1.3, 1.4

Brian Warner warner at users.sourceforge.net
Sat Sep 29 22:51:42 UTC 2007


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

Modified Files:
	test_bonsaipoller.py 
Log Message:
[project @ bonsaipoller: tolerate empty log messages. Closes #90.]

Original author: warner at lothar.com
Date: 2007-09-29 22:51:06+00:00

Index: test_bonsaipoller.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_bonsaipoller.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test_bonsaipoller.py	29 Sep 2007 20:47:24 -0000	1.3
+++ test_bonsaipoller.py	29 Sep 2007 22:51:40 -0000	1.4
@@ -109,6 +109,37 @@
     "BonsaiParser did not raise an exception when there was no <ci> tags"
 }
 
+noCheckinMsgResult = """\
+<?xml version="1.0"?>
+<queryResults>
+<ci who="johndoe at domain.tld" date="12345678">
+ <log></log>
+ <files>
+  <f rev="1.1">first/file.ext</f>
+ </files>
+</ci>
+<ci who="johndoe at domain.tld" date="12345678">
+ <log></log>
+ <files>
+  <f rev="1.2">second/file.ext</f>
+ </files>
+</ci>
+<ci who="johndoe at domain.tld" date="12345678">
+ <log></log>
+ <files>
+  <f rev="1.3">third/file.ext</f>
+ </files>
+</ci>
+</queryResults>
+"""
+
+noCheckinMsgRef = [dict(filename="first/file.ext",
+                     revision="1.1"),
+                dict(filename="second/file.ext",
+                     revision="1.2"),
+                dict(filename="third/file.ext",
+                     revision="1.3")]
+
 class FakeBonsaiPoller(BonsaiPoller):
     def __init__(self):
         BonsaiPoller.__init__(self, "fake url", "fake module", "fake branch")
@@ -179,3 +210,16 @@
         poller._process_changes(badUnparsedResult)
         # self.lastChange will not be updated if the change was not submitted
         self.failUnlessEqual(lastChangeBefore, poller.lastChange)
+
+    def testMergeEmptyLogMsg(self):
+        """Ensure that BonsaiPoller works around the bonsai xml output
+        issue when the check-in comment is empty"""
+        bp = BonsaiParser(noCheckinMsgResult)
+        result = bp.getData()
+        self.failUnlessEqual(len(result.nodes), 1)
+        self.failUnlessEqual(result.nodes[0].who, "johndoe at domain.tld")
+        self.failUnlessEqual(result.nodes[0].date, 12345678)
+        self.failUnlessEqual(result.nodes[0].log, "")
+        for file, ref in zip(result.nodes[0].files, noCheckinMsgRef):
+            self.failUnlessEqual(file.filename, ref['filename'])
+            self.failUnlessEqual(file.revision, ref['revision'])





More information about the Commits mailing list