~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-11-21 21:25:38 UTC
  • mfrom: (14348.1.1 relatedjobs-bug-891600)
  • Revision ID: launchpad@pqm.canonical.com-20111121212538-azocog20hyqze6d2
[r=benji][bug=891600] Fix BuildFarmJobSet.getSpecificJobs to handle
        duplicate jobs correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
            [(build.id, build.__class__) for build in builds],
276
276
            [(job.id, job.__class__) for job in specific_jobs])
277
277
 
 
278
    def test_getSpecificJobs_duplicated_builds(self):
 
279
        builds = self.createBuilds()
 
280
        duplicated_builds = builds + builds
 
281
        specific_jobs = self.build_farm_job_set.getSpecificJobs(
 
282
            [build.build_farm_job for build in duplicated_builds])
 
283
        self.assertEqual(len(duplicated_builds), len(specific_jobs))
 
284
 
278
285
    def test_getSpecificJobs_empty(self):
279
286
        self.assertContentEqual(
280
287
            [],