~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/tests/test_build.py

  • Committer: Stuart Bishop
  • Date: 2011-11-14 07:51:26 UTC
  • mfrom: (14291 devel)
  • mto: This revision was merged to the branch mainline in revision 14299.
  • Revision ID: stuart.bishop@canonical.com-20111114075126-8jhoq57i2qphmch1
Merged rocketfuel into trivial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        # If the package has no uploads, its package_upload is None
155
155
        self.assertEquals(None, build.package_upload)
156
156
 
 
157
    def test_current_component_when_unpublished(self):
 
158
        # Production has some buggy builds without source publications.
 
159
        # current_component returns None in that case.
 
160
        spph = self.publisher.getPubSource()
 
161
        other_das = self.factory.makeDistroArchSeries()
 
162
        build = spph.sourcepackagerelease.createBuild(
 
163
            other_das, PackagePublishingPocket.RELEASE, spph.archive)
 
164
        self.assertIs(None, build.current_component)
 
165
 
157
166
    def test_retry_for_released_series(self):
158
167
        # Builds can not be retried for released distroseries
159
168
        distroseries = self.factory.makeDistroSeries()
395
404
            build.status = BuildStatus.FAILEDTOUPLOAD
396
405
            build.storeUploadLog('foo')
397
406
        self.assertRaises(AssertionError, build.storeUploadLog, 'bar')   
398
 
 
399
 
    def test_assert_with_no_source_history(self):
400
 
        # We can create a BinaryPackageBuild with only an SPR -- this means
401
 
        # that the build has no history (no SourcePackagePublishingHistory),
402
 
        # and we can't queue it.
403
 
        spr = self.factory.makeSourcePackageRelease(
404
 
            distroseries=self.distroseries)
405
 
        build = self.factory.makeBinaryPackageBuild(
406
 
            source_package_release=spr)
407
 
        expected_msg = (
408
 
            "Build %d lacks a corresponding source publication." % (
409
 
                build.id))
410
 
        self.assertRaisesWithContent(
411
 
            AssertionError, expected_msg, build.queueBuild)