[pypy-commit] buildbot 0.8.4-compat: more refactoring to comply with the new API

antocuni noreply at buildbot.pypy.org
Mon Aug 8 13:26:25 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 0.8.4-compat
Changeset: r570:0152c53b0c3f
Date: 2011-08-08 13:28 +0200
http://bitbucket.org/pypy/buildbot/changeset/0152c53b0c3f/

Log:	more refactoring to comply with the new API

diff --git a/bot2/pypybuildbot/builds.py b/bot2/pypybuildbot/builds.py
--- a/bot2/pypybuildbot/builds.py
+++ b/bot2/pypybuildbot/builds.py
@@ -51,7 +51,7 @@
         assert '%' not in symname
         self.symlinkname = os.path.join(masterdest, symname)
         #
-        basename = WithProperties(self.basename).render(properties)
+        basename = WithProperties(self.basename).getRenderingFor(self.build)
         self.masterdest = os.path.join(masterdest, basename)
         #
         transfer.FileUpload.start(self)
diff --git a/bot2/pypybuildbot/test/test_builds.py b/bot2/pypybuildbot/test/test_builds.py
--- a/bot2/pypybuildbot/test/test_builds.py
+++ b/bot2/pypybuildbot/test/test_builds.py
@@ -3,6 +3,11 @@
 from pypybuildbot import builds
 
 class FakeProperties(object):
+
+    def __init__(self):
+        from buildbot.process.properties import PropertyMap
+        self.pmap = PropertyMap(self)
+    
     def __getitem__(self, item):
         if item == 'branch':
             return None
@@ -14,11 +19,14 @@
     def render(self, x):
         return x
 
-class FakePropertyBuilder(object):
+class FakeBuild(object):
     slaveEnvironment = None
+
+    def __init__(self):
+        self.properties = FakeProperties()
     
     def getProperties(self):
-        return FakeProperties()
+        return self.properties
 
     def getSlaveCommandVersion(self, *args):
         return 3
@@ -46,7 +54,8 @@
                 
     assert rebuiltTranslate.command[-len(expected):] == expected
 
-    rebuiltTranslate.build = FakePropertyBuilder()
+    rebuiltTranslate.build = FakeBuild()
+    rebuiltTranslate.setBuild(rebuiltTranslate.build)
     rebuiltTranslate.startCommand = lambda *args: None
     rebuiltTranslate.start()
 
@@ -57,7 +66,7 @@
                              blocksize=100)
     factory, kw = inst.factory
     rebuilt = factory(**kw)
-    rebuilt.build = FakePropertyBuilder()
+    rebuilt.build = FakeBuild()
     rebuilt.step_status = FakeStepStatus()
     rebuilt.runCommand = lambda *args: FakeDeferred()
     rebuilt.start()


More information about the pypy-commit mailing list