[Buildbot-commits] buildbot/buildbot/test test_vc.py,1.22,1.23 test_slavecommand.py,1.7,1.8

Brian Warner warner at users.sourceforge.net
Wed Apr 20 19:32:49 UTC 2005


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

Modified Files:
	test_vc.py test_slavecommand.py 
Log Message:
* buildbot/test/test_slavecommand.py (SlaveCommandTestCase.testShellZ):
win32-compatibility fixes from Nick Trout, the "file not found" message
is different under windows
(FakeSlaveBuilder.__init__): clean up setup a bit
* buildbot/test/test_vc.py (VCSupport.__init__): win32: use os.pathsep


Index: test_slavecommand.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test_slavecommand.py	4 Dec 2004 22:30:23 -0000	1.7
+++ test_slavecommand.py	20 Apr 2005 19:32:46 -0000	1.8
@@ -1,8 +1,7 @@
 #! /usr/bin/python
 
 from twisted.trial import unittest
-from twisted.internet import reactor
-from twisted.internet.defer import Deferred
+from twisted.internet import reactor, defer
 from twisted.python import util
 
 noisy = False
@@ -29,10 +28,10 @@
 class FakeSlaveBuilder:
     usePTY = True # TODO: this probably won't work on non-posix
 
-    def __init__(self):
+    def __init__(self, d):
         self.updates = []
         self.failure = None
-        self.deferred = Deferred()
+        self.deferred = d
         self.basedir = findDir()
     def startBuild(self):
         self.build = FakeSlaveBuild()
@@ -68,8 +67,8 @@
 class SlaveCommandTestCase(SignalMixin, unittest.TestCase):
 
     def setUp(self):
-        self.builder = FakeSlaveBuilder()
-        d = self.builder.deferred
+        d = defer.Deferred()
+        self.builder = FakeSlaveBuilder(d)
         d.addCallback(self.callback)
         self.failed = None
         self.results = None
@@ -160,9 +159,10 @@
         self.failIf(failed)
         self.failUnless(self.getrc() != 0)
         got = self.getfile('stdout')
-        self.failUnless(re.search(r'no such file',
-                                  got,
-                                  re.I))
+        self.failUnless(re.search(r'no such file', got, re.I) # unix
+                        or re.search(r'cannot find the path specified',
+                                     got, re.I) # win32
+                        )
 
     # todo: interrupt(), kill process
 

Index: test_vc.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- test_vc.py	19 Apr 2005 08:37:25 -0000	1.22
+++ test_vc.py	20 Apr 2005 19:32:46 -0000	1.23
@@ -68,7 +68,7 @@
                      'svn': False, 'cvs': False,
                      }
 
-        for p in os.environ['PATH'].split(":"):
+        for p in os.environ['PATH'].split(os.pathsep):
             if os.path.exists(os.path.join(p, 'tla')):
                 self.have['arch'] = True
             if os.path.exists(os.path.join(p, 'darcs')):





More information about the Commits mailing list