2034
2036
copy_job = job_source.getActiveJobs(target_archive).one()
2036
2038
# Its data should reflect the requested copy.
2037
self.assertEqual(source_name, copy_job.package_name)
2038
self.assertEqual(version, copy_job.package_version)
2039
self.assertEqual(target_archive, copy_job.target_archive)
2040
self.assertEqual(source_archive, copy_job.source_archive)
2041
self.assertEqual(to_series, copy_job.target_distroseries)
2042
self.assertEqual(to_pocket, copy_job.target_pocket)
2043
self.assertFalse(copy_job.include_binaries)
2044
self.assertEquals(PackageCopyPolicy.INSECURE, copy_job.copy_policy)
2039
self.assertThat(copy_job, MatchesStructure(
2040
package_name=Equals(source_name),
2041
package_version=Equals(version),
2042
target_archive=Equals(target_archive),
2043
source_archive=Equals(source_archive),
2044
target_distroseries=Equals(to_series),
2045
target_pocket=Equals(to_pocket),
2046
include_binaries=Equals(False),
2047
copy_policy=Equals(PackageCopyPolicy.INSECURE)))
2046
2049
def test_copyPackage_disallows_non_primary_archive_uploaders(self):
2047
2050
# If copying to a primary archive and you're not an uploader for
2115
2118
# There should be one copy job.
2116
2119
job_source = getUtility(IPlainPackageCopyJobSource)
2117
2120
copy_job = job_source.getActiveJobs(target_archive).one()
2118
self.assertEqual(target_archive, copy_job.target_archive)
2121
self.assertThat(copy_job, MatchesStructure(
2122
package_name=Equals(source_name),
2123
package_version=Equals(version),
2124
target_archive=Equals(target_archive),
2125
source_archive=Equals(source_archive),
2126
target_distroseries=Equals(to_series),
2127
target_pocket=Equals(to_pocket),
2128
include_binaries=Equals(False),
2129
copy_policy=Equals(PackageCopyPolicy.INSECURE)))
2120
2131
def test_copyPackages_with_multiple_packages(self):
2121
2132
(source, source_archive, source_name, target_archive, to_pocket,