~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/tests/test_sourcepackagerecipebuild.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-06-13 05:56:31 UTC
  • mfrom: (10899.2.26 daily-builds-score)
  • Revision ID: launchpad@pqm.canonical.com-20100613055631-yppps9lg51ffg0do
[r=rockstar][ui=none][bug=585993] Ensure manual build requests have
        higher scores than daily builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
    def test_binary_builds(self):
194
194
        """The binary_builds property should be populated automatically."""
195
195
        spb = self.factory.makeSourcePackageRecipeBuild()
 
196
        multiverse = self.factory.makeComponent(name='multiverse')
196
197
        spr = self.factory.makeSourcePackageRelease(
197
 
            source_package_recipe_build=spb)
 
198
            source_package_recipe_build=spb, component=multiverse)
198
199
        self.assertEqual([], list(spb.binary_builds))
199
200
        binary = self.factory.makeBinaryPackageBuild(spr)
200
201
        self.factory.makeBinaryPackageBuild()
201
202
        Store.of(binary).flush()
202
203
        self.assertEqual([binary], list(spb.binary_builds))
203
204
 
 
205
    def test_makeDailyBuilds(self):
 
206
        self.assertEqual([],
 
207
            SourcePackageRecipeBuild.makeDailyBuilds())
 
208
        recipe = self.factory.makeSourcePackageRecipe(build_daily=True)
 
209
        build = SourcePackageRecipeBuild.makeDailyBuilds()[0]
 
210
        self.assertEqual(recipe, build.recipe)
 
211
        self.assertEqual(list(recipe.distroseries), [build.distroseries])
 
212
 
204
213
    def test_getRecentBuilds(self):
205
214
        """Recent builds match the same person, series and receipe.
206
215
 
231
240
        removeSecurityProxy(recent_build).datecreated += a_second
232
241
        self.assertContentEqual([recent_build], get_recent())
233
242
 
 
243
 
234
244
class TestAsBuildmaster(TestCaseWithFactory):
235
245
 
236
246
    layer = LaunchpadZopelessLayer