~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/tests/test_builder.py

  • Committer: Gavin Panella
  • Date: 2012-01-03 13:44:35 UTC
  • mto: This revision was merged to the branch mainline in revision 14641.
  • Revision ID: gavin.panella@canonical.com-20120103134435-om041v7ijceqr745
Fix some lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        self.addCleanup(config.pop, 'reset')
196
196
 
197
197
        with BuilddManagerTestFixture.extraSetUp():
198
 
            builder = self.factory.makeBuilder(virtualized=True, vm_host="pop")
 
198
            builder = self.factory.makeBuilder(
 
199
                virtualized=True, vm_host="pop")
199
200
        d = builder.resumeSlaveHost()
200
201
        def got_resume(output):
201
202
            self.assertEqual(('parp', ''), output)
208
209
        config.push('reset fail', reset_fail_config)
209
210
        self.addCleanup(config.pop, 'reset fail')
210
211
        with BuilddManagerTestFixture.extraSetUp():
211
 
            builder = self.factory.makeBuilder(virtualized=True, vm_host="pop")
 
212
            builder = self.factory.makeBuilder(
 
213
                virtualized=True, vm_host="pop")
212
214
        d = builder.resumeSlaveHost()
213
215
        return assert_fails_with(d, CannotResumeHost)
214
216
 
219
221
        config.push('reset fail', reset_fail_config)
220
222
        self.addCleanup(config.pop, 'reset fail')
221
223
        with BuilddManagerTestFixture.extraSetUp():
222
 
            builder = self.factory.makeBuilder(virtualized=True, vm_host="pop")
 
224
            builder = self.factory.makeBuilder(
 
225
                virtualized=True, vm_host="pop")
223
226
            builder.builderok = True
224
227
        d = builder.handleTimeout(BufferLogger(), 'blah')
225
228
        return assert_fails_with(d, CannotResumeHost)
349
352
        # rescueIfLost does not attempt to abort or clean a builder that is
350
353
        # WAITING.
351
354
        waiting_slave = WaitingSlave()
352
 
        builder = MockBuilder("mock_builder", waiting_slave, TrivialBehavior())
 
355
        builder = MockBuilder(
 
356
            "mock_builder", waiting_slave, TrivialBehavior())
353
357
        d = builder.rescueIfLost()
354
358
        def check_slave_calls(ignored):
355
359
            self.assertNotIn('abort', waiting_slave.call_log)
363
367
        # builder is reset for a new build, and the corrupt build is
364
368
        # discarded.
365
369
        waiting_slave = WaitingSlave()
366
 
        builder = MockBuilder("mock_builder", waiting_slave, CorruptBehavior())
 
370
        builder = MockBuilder(
 
371
            "mock_builder", waiting_slave, CorruptBehavior())
367
372
        d = builder.rescueIfLost()
368
373
        def check_slave_calls(ignored):
369
374
            self.assertNotIn('abort', waiting_slave.call_log)
386
391
        # If a slave is BUILDING with a build id we don't recognize, then we
387
392
        # abort the build, thus stopping it in its tracks.
388
393
        building_slave = BuildingSlave()
389
 
        builder = MockBuilder("mock_builder", building_slave, CorruptBehavior())
 
394
        builder = MockBuilder(
 
395
            "mock_builder", building_slave, CorruptBehavior())
390
396
        d = builder.rescueIfLost()
391
397
        def check_slave_calls(ignored):
392
398
            self.assertIn('abort', building_slave.call_log)
740
746
    def test_findBuildCandidate_with_disabled_archive(self):
741
747
        # Disabled archives should not be considered for dispatching
742
748
        # builds.
743
 
        disabled_job = removeSecurityProxy(self.builder4)._findBuildCandidate()
 
749
        disabled_job = removeSecurityProxy(
 
750
            self.builder4)._findBuildCandidate()
744
751
        with BuilddManagerTestFixture.extraSetUp():
745
752
            build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(
746
753
                disabled_job)