~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-06 09:08:39 UTC
  • mfrom: (14421.2.8 sponsor-syncs-bug-827555)
  • Revision ID: launchpad@pqm.canonical.com-20111206090839-fm73xxdr08hyvasc
[r=benji][bug=827555] Make the package copier accept a "sponsored"
 Person which will be used as the SPPH.creator and From: address on
 announcement emails. Also expose the new parameter on
 IArchive.copyPackage[s]() on the API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        archive1 = self.factory.makeArchive(distroseries.distribution)
137
137
        archive2 = self.factory.makeArchive(distroseries.distribution)
138
138
        requester = self.factory.makePerson()
 
139
        sponsored = self.factory.makePerson()
139
140
        source = getUtility(IPlainPackageCopyJobSource)
140
141
        job = source.create(
141
142
            package_name="foo", source_archive=archive1,
143
144
            target_pocket=PackagePublishingPocket.RELEASE,
144
145
            package_version="1.0-1", include_binaries=False,
145
146
            copy_policy=PackageCopyPolicy.MASS_SYNC,
146
 
            requester=requester)
 
147
            requester=requester, sponsored=sponsored)
147
148
        self.assertProvides(job, IPackageCopyJob)
148
149
        self.assertEquals(archive1.id, job.source_archive_id)
149
150
        self.assertEquals(archive1, job.source_archive)
156
157
        self.assertEquals(False, job.include_binaries)
157
158
        self.assertEquals(PackageCopyPolicy.MASS_SYNC, job.copy_policy)
158
159
        self.assertEqual(requester, job.requester)
 
160
        self.assertEqual(sponsored, job.sponsored)
159
161
 
160
162
    def test_createMultiple_creates_one_job_per_copy(self):
161
163
        mother = self.factory.makeDistroSeriesParent()