Esempio n. 1
0
    def testCheckSlaveVersionGood(self):
        # patch BuildStep.slaveVersion() to return success
        mockedSlaveVersion = Mock()
        self.patch(buildstep.BuildStep, "slaveVersion", mockedSlaveVersion)

        # check that no exceptions are raised
        transfer._TransferBuildStep().checkSlaveVersion("foo")

        # make sure slaveVersion() was called with correct arguments
        mockedSlaveVersion.assert_called_once_with("foo")
Esempio n. 2
0
    def testCheckSlaveVersionTooOld(self):
        # patch BuildStep.slaveVersion() to return error
        self.patch(buildstep.BuildStep, "slaveVersion",
                   Mock(return_value=None))

        # make sure appropriate exception is raised
        step = transfer._TransferBuildStep()
        self.assertRaisesRegexp(interfaces.BuildSlaveTooOldError,
                                "slave is too old, does not know about foo",
                                step.checkSlaveVersion, "foo")
    def testCheckSlaveVersionTooOld(self):
        # patch BuildStep.slaveVersion() to return error
        self.patch(buildstep.BuildStep,
                   "slaveVersion",
                   Mock(return_value=None))

        # make sure appropriate exception is raised
        step = transfer._TransferBuildStep()
        self.assertRaisesRegexp(interfaces.BuildSlaveTooOldError,
                                "slave is too old, does not know about foo",
                                step.checkSlaveVersion, "foo")