~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-13 11:53:55 UTC
  • mfrom: (13383.1.2 bug-803344)
  • Revision ID: launchpad@pqm.canonical.com-20110713115355-3crwphu7bjya8xq8
[r=henninge][bug=803344] Copy packageset permissions when
        initializing a new distroseries from a parent series in the
        same distribution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
            [(u'udev', u'0.1-1'), (u'firefox', u'2.1')],
325
325
            pub_sources)
326
326
 
 
327
    def test_intra_distro_perm_copying(self):
 
328
        # If child.distribution equals parent.distribution, we also
 
329
        # copy the archivepermissions.
 
330
        parent, unused = self.setupParent()
 
331
        uploader = self.factory.makePerson()
 
332
        test1 = self.factory.makePackageset(
 
333
            u'test1', u'test 1 packageset', parent.owner,
 
334
            distroseries=parent)
 
335
        #test1 = getUtility(IPackagesetSet).new(
 
336
        #    u'test1', u'test 1 packageset', self.parent.owner,
 
337
        #    distroseries=self.parent)
 
338
        test1.addSources('udev')
 
339
        archive_permset = getUtility(IArchivePermissionSet)
 
340
        archive_permset.newPackagesetUploader(
 
341
            parent.main_archive, uploader, test1)
 
342
        # Create child series in the same distribution.
 
343
        child = self.factory.makeDistroSeries(
 
344
            distribution=parent.distribution,
 
345
            previous_series=parent)
 
346
        self._fullInitialize([parent], child=child)
 
347
 
 
348
        # The uploader can upload to the new distroseries.
 
349
        self.assertTrue(archive_permset.isSourceUploadAllowed(
 
350
                parent.main_archive, 'udev', uploader,
 
351
                distroseries=parent))
 
352
        self.assertTrue(archive_permset.isSourceUploadAllowed(
 
353
                child.main_archive, 'udev', uploader,
 
354
                distroseries=child))
 
355
 
327
356
    def test_no_cross_distro_perm_copying(self):
328
357
        # No cross-distro archivepermissions copying should happen.
329
358
        self.parent, self.parent_das = self.setupParent()