[Buildbot-commits] buildbot/buildbot/test test_mailparse.py, 1.7, 1.8

Brian Warner warner at users.sourceforge.net
Sat Jul 28 16:48:36 UTC 2007


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

Modified Files:
	test_mailparse.py 
Log Message:
[project @ mail.py: add changesource for SVN's commit-email.pl script, contributed by Justin Mason. Closes SF#1072845.]

Original author: warner at lothar.com
Date: 2007-07-28 16:47:40+00:00

Index: test_mailparse.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_mailparse.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test_mailparse.py	28 Jul 2007 05:57:55 -0000	1.7
+++ test_mailparse.py	28 Jul 2007 16:48:34 -0000	1.8
@@ -2,13 +2,13 @@
 
 from twisted.trial import unittest
 from twisted.python import util
-from buildbot.changes.mail import FCMaildirSource, SyncmailMaildirSource
+from buildbot.changes import mail
 
-class Test1(unittest.TestCase):
+class TestFreshCVS(unittest.TestCase):
 
     def get(self, msg):
         msg = util.sibpath(__file__, msg)
-        s = FCMaildirSource(None)
+        s = mail.FCMaildirSource(None)
         return s.parse(open(msg, "r"))
 
     def testMsg1(self):
@@ -108,10 +108,10 @@
         self.assertEqual(c.isdir, 1)
 
 
-class Test2(unittest.TestCase):
+class TestFreshCVS_Prefix(unittest.TestCase):
     def get(self, msg):
         msg = util.sibpath(__file__, msg)
-        s = FCMaildirSource(None)
+        s = mail.FCMaildirSource(None)
         return s.parse(open(msg, "r"), prefix="Twisted/")
 
     def testMsg1p(self):
@@ -195,15 +195,15 @@
         self.assertEqual(c, None)
 
 
-class Test3(unittest.TestCase):
+class TestSyncmail(unittest.TestCase):
     def get(self, msg):
         msg = util.sibpath(__file__, msg)
-        s = SyncmailMaildirSource(None)
+        s = mail.SyncmailMaildirSource(None)
         return s.parse(open(msg, "r"), prefix="buildbot/")
 
     def getNoPrefix(self, msg):
         msg = util.sibpath(__file__, msg)
-        s = SyncmailMaildirSource(None)
+        s = mail.SyncmailMaildirSource(None)
         return s.parse(open(msg, "r"))
 
     def testMsgS1(self):
@@ -249,3 +249,45 @@
                                    ])
         self.assertEqual(c.branch, "BRANCH-DEVEL")
         self.assertEqual(c.isdir, 0)
+
+
+class TestSVNCommitEmail(unittest.TestCase):
+    def get(self, msg, prefix):
+        msg = util.sibpath(__file__, msg)
+        s = mail.SVNCommitEmailMaildirSource(None)
+        return s.parse(open(msg, "r"), prefix)
+
+    def test1(self):
+        c = self.get("mail/svn-commit.1", "spamassassin/trunk/")
+        self.failUnless(c)
+        self.failUnlessEqual(c.who, "felicity")
+        self.failUnlessEqual(c.files, ["sa-update.raw"])
+        self.failUnlessEqual(c.branch, None)
+        self.failUnlessEqual(c.comments,
+                             "bug 4864: remove extraneous front-slash "
+                             "from gpghomedir path\n")
+
+    def test2a(self):
+        c = self.get("mail/svn-commit.2", "spamassassin/trunk/")
+        self.failIf(c)
+
+    def test2b(self):
+        c = self.get("mail/svn-commit.2", "spamassassin/branches/3.1/")
+        self.failUnless(c)
+        self.failUnlessEqual(c.who, "sidney")
+        self.failUnlessEqual(c.files,
+                             ["lib/Mail/SpamAssassin/Timeout.pm",
+                              "MANIFEST",
+                              "lib/Mail/SpamAssassin/Logger.pm",
+                              "lib/Mail/SpamAssassin/Plugin/DCC.pm",
+                              "lib/Mail/SpamAssassin/Plugin/DomainKeys.pm",
+                              "lib/Mail/SpamAssassin/Plugin/Pyzor.pm",
+                              "lib/Mail/SpamAssassin/Plugin/Razor2.pm",
+                              "lib/Mail/SpamAssassin/Plugin/SPF.pm",
+                              "lib/Mail/SpamAssassin/SpamdForkScaling.pm",
+                              "spamd/spamd.raw",
+                              ])
+        self.failUnlessEqual(c.comments,
+                             "Bug 4696: consolidated fixes for timeout bugs\n")
+
+





More information about the Commits mailing list