コード例 #1
0
    def test_buildStarted_missing(self):
        """
        If the slave associated to slave builder doesn not have a
        ``buildStarted`` method, calling ``buildStarted`` on the slave builder
        doesn't raise an exception.
        """
        class ConcreteBuildSlave(AbstractBuildSlave):
            pass

        slave = ConcreteBuildSlave("slave", "pass")
        slavebuilder = AbstractSlaveBuilder()
        # FIXME: This should call attached, instead of setting the attribute
        # directly
        slavebuilder.slave = slave

        # The following shouldn't raise an exception.
        slavebuilder.buildStarted()
コード例 #2
0
    def test_buildStarted_missing(self):
        """
        If the slave associated to slave builder doesn not have a
        ``buildStarted`` method, calling ``buildStarted`` on the slave builder
        doesn't raise an exception.
        """

        class ConcreteBuildSlave(AbstractBuildSlave):
            pass

        slave = ConcreteBuildSlave("slave", "pass")
        slavebuilder = AbstractSlaveBuilder()
        # FIXME: This should call attached, instead of setting the attribute
        # directly
        slavebuilder.slave = slave

        # The following shouldn't raise an exception.
        slavebuilder.buildStarted()
コード例 #3
0
    def test_buildStarted_called(self):
        """
        If the slave associated to slave builder has a ``buildStarted`` method,
        calling ``buildStarted`` on the slave builder calls the method on the
        slave with the slavebuilder as an argument.
        """
        class ConcreteBuildSlave(AbstractBuildSlave):
            _buildStartedCalls = []

            def buildStarted(self, slavebuilder):
                self._buildStartedCalls.append(slavebuilder)

        slave = ConcreteBuildSlave("slave", "pass")
        slavebuilder = AbstractSlaveBuilder()
        # FIXME: This should call attached, instead of setting the attribute
        # directly
        slavebuilder.slave = slave
        slavebuilder.buildStarted()

        self.assertEqual(ConcreteBuildSlave._buildStartedCalls, [slavebuilder])
コード例 #4
0
    def test_buildStarted_called(self):
        """
        If the slave associated to slave builder has a ``buildStarted`` method,
        calling ``buildStarted`` on the slave builder calls the method on the
        slave with the slavebuilder as an argument.
        """

        class ConcreteBuildSlave(AbstractBuildSlave):
            _buildStartedCalls = []

            def buildStarted(self, slavebuilder):
                self._buildStartedCalls.append(slavebuilder)

        slave = ConcreteBuildSlave("slave", "pass")
        slavebuilder = AbstractSlaveBuilder()
        # FIXME: This should call attached, instead of setting the attribute
        # directly
        slavebuilder.slave = slave
        slavebuilder.buildStarted()

        self.assertEqual(ConcreteBuildSlave._buildStartedCalls, [slavebuilder])
コード例 #5
0
def slavebuilder_buildStarted(self):
    AbstractSlaveBuilder.buildStarted(self)
    if self.slave and hasattr(self.slave, 'buildStarted'):
        self.slave.buildStarted(self)
コード例 #6
0
def slavebuilder_buildStarted(self):
    AbstractSlaveBuilder.buildStarted(self)
    if self.slave and hasattr(self.slave, 'buildStarted'):
        self.slave.buildStarted(self)