[Buildbot-commits] buildbot/buildbot/test test_runner.py,1.9,1.10

Brian Warner warner at users.sourceforge.net
Wed Aug 31 01:51:27 UTC 2005


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

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

'try': implement unique buildset IDs, getTopdir for CVS/SVN

	* buildbot/scripts/tryclient.py (getTopdir): implement getTopdir
	for 'try' on CVS/SVN
	* buildbot/test/test_runner.py (Try.testGetTopdir): test case

	* buildbot/scripts/tryclient.py (Try.createJob): implement unique
	buildset IDs


Index: test_runner.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test_runner.py	11 Aug 2005 20:21:30 -0000	1.9
+++ test_runner.py	31 Aug 2005 01:51:25 -0000	1.10
@@ -237,3 +237,34 @@
         self.failUnlessEqual(t.connect, "ssh")
         self.failUnlessEqual(t.builderNames, ['b'])
 
+    def testGetTopdir(self):
+        os.mkdir("gettopdir")
+        os.mkdir(os.path.join("gettopdir", "foo"))
+        os.mkdir(os.path.join("gettopdir", "foo", "bar"))
+        open(os.path.join("gettopdir", "1"),"w").write("1")
+        open(os.path.join("gettopdir", "foo", "2"),"w").write("2")
+        open(os.path.join("gettopdir", "foo", "bar", "3"),"w").write("3")
+
+        target = os.path.abspath("gettopdir")
+        t = tryclient.getTopdir("1", "gettopdir")
+        self.failUnlessEqual(os.path.abspath(t), target)
+        t = tryclient.getTopdir("1", os.path.join("gettopdir", "foo"))
+        self.failUnlessEqual(os.path.abspath(t), target)
+        t = tryclient.getTopdir("1", os.path.join("gettopdir", "foo", "bar"))
+        self.failUnlessEqual(os.path.abspath(t), target)
+
+        target = os.path.abspath(os.path.join("gettopdir", "foo"))
+        t = tryclient.getTopdir("2", os.path.join("gettopdir", "foo"))
+        self.failUnlessEqual(os.path.abspath(t), target)
+        t = tryclient.getTopdir("2", os.path.join("gettopdir", "foo", "bar"))
+        self.failUnlessEqual(os.path.abspath(t), target)
+
+        target = os.path.abspath(os.path.join("gettopdir", "foo", "bar"))
+        t = tryclient.getTopdir("3", os.path.join("gettopdir", "foo", "bar"))
+        self.failUnlessEqual(os.path.abspath(t), target)
+
+        nonexistent = "nonexistent\n29fis3kq\tBAR"
+        # hopefully there won't be a real file with that name between here
+        # and the filesystem root.
+        self.failUnlessRaises(ValueError, tryclient.getTopdir, nonexistent)
+





More information about the Commits mailing list