[Buildbot-commits] buildbot/buildbot/test test_vc.py,1.53,1.54

Brian Warner warner at users.sourceforge.net
Fri May 19 06:28:12 UTC 2006


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

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

test_vc.py: refactor repository-setup stuff out into helper classes

	* buildbot/test/test_vc.py (VCS_Helper): factor out all the
	setup-repository and do-we-have-the-vc-tools code into a separate
	"helper" class, which sticks around in a single module-level
	object. This seems more likely to continue to work in the future
	than having it hide in the TestCase and hope that TestCases stick
	around for a long time.


Index: test_vc.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- test_vc.py	19 May 2006 06:20:01 -0000	1.53
+++ test_vc.py	19 May 2006 06:28:10 -0000	1.54
@@ -48,9 +48,6 @@
 # is running).
 
 
-VCS = {} # maps VC name to pathname of the executable
-
-
 config_vc = """
 from buildbot.process import factory, step
 s = factory.s
@@ -159,6 +156,65 @@
 }
[...1347 lines suppressed...]
         d = self.do_getpatch()
         return maybeWait(d)
-    
+
+VCS.registerVC(Mercurial.vc_name, MercurialHelper())
+
 
 class Sources(unittest.TestCase):
     # TODO: this needs serious rethink
@@ -2048,8 +2132,9 @@
         # invoke 'patch' all by itself, to see if it works the way we think
         # it should. This is intended to ferret out some windows test
         # failures.
+        helper = BaseHelper()
         self.workdir = os.path.join("test_vc", "testPatch")
-        self.populate(self.workdir)
+        helper.populate(self.workdir)
         patch = which("patch")[0]
 
         command = [patch, "-p0"]





More information about the Commits mailing list