581
583
self.assertEqual('restricted', new_publication.component.name)
582
584
self.assertEqual('games', new_publication.section.name)
586
def test_copying_to_ppa_archive(self):
587
# Packages can be copied into PPA archives.
588
publisher = SoyuzTestPublisher()
589
publisher.prepareBreezyAutotest()
590
distroseries = publisher.breezy_autotest
592
target_archive = self.factory.makeArchive(
593
distroseries.distribution, purpose=ArchivePurpose.PPA)
594
source_archive = self.factory.makeArchive()
596
# Publish a package in the source archive with some overridable
597
# properties set to known values.
598
publisher.getPubSource(
599
distroseries=distroseries, sourcename="libc",
600
component='universe', section='web',
601
version="2.8-1", status=PackagePublishingStatus.PUBLISHED,
602
archive=source_archive)
604
# Now, run the copy job.
605
source = getUtility(IPlainPackageCopyJobSource)
606
requester = self.factory.makePerson()
607
with person_logged_in(target_archive.owner):
608
target_archive.newComponentUploader(requester, "main")
611
package_version="2.8-1",
612
source_archive=source_archive,
613
target_archive=target_archive,
614
target_distroseries=distroseries,
615
target_pocket=PackagePublishingPocket.RELEASE,
616
include_binaries=False,
620
self.assertEqual(JobStatus.COMPLETED, job.status)
622
new_publication = target_archive.getPublishedSources(
623
name='libc', version='2.8-1').one()
624
self.assertEqual('main', new_publication.component.name)
625
self.assertEqual('web', new_publication.section.name)
584
627
def test_copying_to_main_archive_manual_overrides(self):
585
628
# Test processing a packagecopyjob that has manual overrides.
586
629
publisher = SoyuzTestPublisher()