[Buildbot-commits] buildbot/buildbot/test test_vc.py,1.30,1.31

Brian Warner warner at users.sourceforge.net
Tue May 17 10:38:18 UTC 2005


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

Modified Files:
	test_vc.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-189
Creator:  Brian Warner <warner at monolith.lothar.com>

handle string-in-string tests under python-2.2

	* buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a
	version that can handle string-in-string tests, because otherwise
	python-2.2 fails the tests. It'd be tremendous if Trial's test
	took two strings under 2.2 too.


Index: test_vc.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- test_vc.py	17 May 2005 10:14:10 -0000	1.30
+++ test_vc.py	17 May 2005 10:38:10 -0000	1.31
@@ -170,6 +170,11 @@
     httpServer = None
     httpPort = None
 
+    def failUnlessIn(self, substring, string, msg=None):
+        # trial provides a version of this that requires python-2.3 to test
+        # strings.
+        self.failUnless(string.find(substring) != -1, msg)
+
     def setUpClass(self):
         global VCS
         if VCS is None:
@@ -185,11 +190,13 @@
                                     "BUILDBOT_TEST_VC=path/to/repositories "
                                     "to run this")
         self.serveHTTP()
-        shutil.rmtree("basedir", ignore_errors=1)
+        if os.path.exists("basedir"):
+            shutil.rmtree("basedir")
         os.mkdir("basedir")
         self.master = master.BuildMaster("basedir")
         self.slavebase = os.path.abspath("slavebase")
-        shutil.rmtree(self.slavebase, ignore_errors=1)
+        if os.path.exists(self.slavebase):
+            shutil.rmtree(self.slavebase)
         os.mkdir("slavebase")
 
     def serveHTTP(self):





More information about the Commits mailing list