~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

Merged packageset-picker-5 into lazr-anim-stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        package = self.factory.makeSourcePackageName()
102
102
        parent_series = self.factory.makeDistroSeries()
103
103
        self.assertEqual(
104
 
            make_metadata(package, parent_series),
105
 
            make_metadata(package, parent_series))
 
104
            make_metadata(package.id, parent_series.id),
 
105
            make_metadata(package.id, parent_series.id))
106
106
 
107
107
    def test_make_metadata_distinguishes_packages(self):
108
108
        parent_series = self.factory.makeDistroSeries()
109
109
        one_package = self.factory.makeSourcePackageName()
110
110
        another_package = self.factory.makeSourcePackageName()
111
111
        self.assertNotEqual(
112
 
            make_metadata(one_package, parent_series),
113
 
            make_metadata(another_package, parent_series))
 
112
            make_metadata(one_package.id, parent_series.id),
 
113
            make_metadata(another_package.id, parent_series.id))
114
114
 
115
115
    def test_make_metadata_distinguishes_parents(self):
116
116
        package = self.factory.makeSourcePackageName()
117
117
        one_parent = self.factory.makeDistroSeries()
118
118
        another_parent = self.factory.makeDistroSeries()
119
119
        self.assertNotEqual(
120
 
            make_metadata(package, one_parent),
121
 
            make_metadata(package, another_parent))
122
 
 
123
 
    def test_may_require_job_accepts_none_derived_series(self):
124
 
        parent_series = self.factory.makeDistroSeriesParent().parent_series
125
 
        package = self.factory.makeSourcePackageName()
126
 
        self.assertFalse(may_require_job(None, package, parent_series))
 
120
            make_metadata(package.id, one_parent.id),
 
121
            make_metadata(package.id, another_parent.id))
127
122
 
128
123
    def test_may_require_job_allows_new_jobs(self):
129
124
        dsp = self.factory.makeDistroSeriesParent()
138
133
        self.assertFalse(
139
134
            may_require_job(dsp.derived_series, package, dsp.parent_series))
140
135
 
141
 
    def test_may_require_job_forbids_jobs_on_nonderived_series(self):
142
 
        sourcepackage = self.factory.makeSourcePackage()
143
 
        self.assertFalse(may_require_job(
144
 
            sourcepackage.distroseries, sourcepackage.sourcepackagename,
145
 
            None))
146
 
 
147
136
    def test_may_require_job_forbids_jobs_for_intra_distro_derivation(self):
148
137
        package = self.factory.makeSourcePackageName()
149
138
        parent = self.factory.makeDistroSeries()