Merge ~cjwatson/launchpad:pyupgrade-py3-soyuz into launchpad:master
- Git
- lp:~cjwatson/launchpad
- pyupgrade-py3-soyuz
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 14807bb7894c836bd00455eb7485b7f6731135c5 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:pyupgrade-py3-soyuz |
Merge into: | launchpad:master |
Diff against target: |
3602 lines (+400/-425) 111 files modified
.git-blame-ignore-revs (+2/-0) .pre-commit-config.yaml (+1/-0) lib/lp/soyuz/adapters/overrides.py (+3/-3) lib/lp/soyuz/adapters/tests/test_archivedependencies.py (+1/-1) lib/lp/soyuz/adapters/tests/test_buildarch.py (+1/-1) lib/lp/soyuz/adapters/tests/test_packagelocation.py (+7/-7) lib/lp/soyuz/browser/archive.py (+10/-10) lib/lp/soyuz/browser/archivepermission.py (+1/-1) lib/lp/soyuz/browser/archivesubscription.py (+5/-5) lib/lp/soyuz/browser/build.py (+1/-1) lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py (+2/-2) lib/lp/soyuz/browser/livefs.py (+8/-8) lib/lp/soyuz/browser/livefsbuild.py (+1/-1) lib/lp/soyuz/browser/packagerelationship.py (+2/-2) lib/lp/soyuz/browser/publishing.py (+5/-5) lib/lp/soyuz/browser/sourceslist.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive_admin_view.py (+1/-1) lib/lp/soyuz/browser/tests/test_archive_packages.py (+3/-3) lib/lp/soyuz/browser/tests/test_archive_webservice.py (+3/-3) lib/lp/soyuz/browser/tests/test_archivesubscription.py (+1/-1) lib/lp/soyuz/browser/tests/test_breadcrumbs.py (+2/-2) lib/lp/soyuz/browser/tests/test_build_views.py (+1/-1) lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py (+1/-1) lib/lp/soyuz/browser/tests/test_distroarchseries_view.py (+1/-1) lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py (+1/-1) lib/lp/soyuz/browser/tests/test_livefs.py (+6/-6) lib/lp/soyuz/browser/tests/test_livefsbuild.py (+3/-3) lib/lp/soyuz/browser/tests/test_publishing.py (+1/-1) lib/lp/soyuz/browser/tests/test_queue.py (+1/-1) lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py (+1/-1) lib/lp/soyuz/interfaces/archive.py (+8/-10) lib/lp/soyuz/interfaces/distributionjob.py (+2/-2) lib/lp/soyuz/interfaces/livefs.py (+6/-6) lib/lp/soyuz/interfaces/publishing.py (+6/-6) lib/lp/soyuz/interfaces/queue.py (+4/-4) lib/lp/soyuz/mail/binarypackagebuild.py (+5/-8) lib/lp/soyuz/mail/livefsbuild.py (+3/-4) lib/lp/soyuz/mail/packageupload.py (+9/-13) lib/lp/soyuz/mail/tests/test_packageupload.py (+12/-12) lib/lp/soyuz/model/archive.py (+13/-13) lib/lp/soyuz/model/archivedependency.py (+1/-1) lib/lp/soyuz/model/archivefile.py (+1/-1) lib/lp/soyuz/model/archivejob.py (+4/-5) lib/lp/soyuz/model/archivepermission.py (+3/-4) lib/lp/soyuz/model/binaryandsourcepackagename.py (+1/-2) lib/lp/soyuz/model/binarypackagebuildbehaviour.py (+1/-2) lib/lp/soyuz/model/binarypackagename.py (+0/-1) lib/lp/soyuz/model/binarypackagerelease.py (+2/-2) lib/lp/soyuz/model/binarysourcereference.py (+1/-1) lib/lp/soyuz/model/distributionjob.py (+2/-2) lib/lp/soyuz/model/distroarchseriesfilter.py (+1/-1) lib/lp/soyuz/model/initializedistroseriesjob.py (+3/-4) lib/lp/soyuz/model/livefs.py (+1/-1) lib/lp/soyuz/model/livefsbuild.py (+3/-3) lib/lp/soyuz/model/livefsbuildbehaviour.py (+1/-2) lib/lp/soyuz/model/packagecopyjob.py (+5/-5) lib/lp/soyuz/model/packagediff.py (+1/-2) lib/lp/soyuz/model/packageset.py (+2/-2) lib/lp/soyuz/model/processacceptedbugsjob.py (+1/-1) lib/lp/soyuz/model/publishing.py (+7/-8) lib/lp/soyuz/model/queue.py (+4/-5) lib/lp/soyuz/model/sourcepackagerelease.py (+1/-1) lib/lp/soyuz/scripts/custom_uploads_copier.py (+1/-3) lib/lp/soyuz/scripts/ftpmasterbase.py (+0/-2) lib/lp/soyuz/scripts/gina/handlers.py (+1/-3) lib/lp/soyuz/scripts/gina/runner.py (+1/-1) lib/lp/soyuz/scripts/packagecopier.py (+1/-2) lib/lp/soyuz/scripts/populate_archive.py (+1/-1) lib/lp/soyuz/scripts/ppareport.py (+1/-1) lib/lp/soyuz/scripts/retrydepwait.py (+1/-1) lib/lp/soyuz/scripts/tests/test_copypackage.py (+16/-16) lib/lp/soyuz/scripts/tests/test_expire_archive_files.py (+4/-4) lib/lp/soyuz/scripts/tests/test_gina.py (+2/-2) lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+80/-80) lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py (+1/-1) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+8/-8) lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py (+1/-1) lib/lp/soyuz/scripts/tests/test_retrydepwait.py (+2/-2) lib/lp/soyuz/tests/test_archive.py (+17/-18) lib/lp/soyuz/tests/test_archive_subscriptions.py (+2/-2) lib/lp/soyuz/tests/test_binaryandsourcepackagename.py (+1/-1) lib/lp/soyuz/tests/test_binarypackagebuild.py (+6/-6) lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py (+2/-2) lib/lp/soyuz/tests/test_binarypackagename.py (+1/-1) lib/lp/soyuz/tests/test_binarysourcereference.py (+1/-1) lib/lp/soyuz/tests/test_build.py (+1/-1) lib/lp/soyuz/tests/test_build_depwait.py (+1/-1) lib/lp/soyuz/tests/test_build_notify.py (+1/-1) lib/lp/soyuz/tests/test_build_privacy.py (+1/-1) lib/lp/soyuz/tests/test_build_set.py (+5/-5) lib/lp/soyuz/tests/test_build_start_estimation.py (+1/-1) lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py (+2/-2) lib/lp/soyuz/tests/test_distroseriesbinarypackage.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesdifferencejob.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py (+1/-1) lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py (+2/-2) lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py (+1/-1) lib/lp/soyuz/tests/test_hasbuildrecords.py (+7/-7) lib/lp/soyuz/tests/test_livefs.py (+3/-3) lib/lp/soyuz/tests/test_livefsbuild.py (+4/-4) lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+1/-1) lib/lp/soyuz/tests/test_packagecopyjob.py (+3/-3) lib/lp/soyuz/tests/test_packageset.py (+5/-5) lib/lp/soyuz/tests/test_packageupload.py (+4/-4) lib/lp/soyuz/tests/test_processacceptedbugsjob.py (+3/-3) lib/lp/soyuz/tests/test_publishing.py (+5/-5) lib/lp/soyuz/tests/test_publishing_models.py (+1/-1) lib/lp/soyuz/wsgi/tests/test_archiveauth.py (+1/-1) lib/lp/soyuz/xmlrpc/tests/test_archive.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+413916@code.launchpad.net |
Commit message
lp.soyuz: Apply "pyupgrade --py3-plus"
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs | |||
2 | index c6458be..7b39f1f 100644 | |||
3 | --- a/.git-blame-ignore-revs | |||
4 | +++ b/.git-blame-ignore-revs | |||
5 | @@ -42,3 +42,5 @@ fbed83f22424df8fa5647349493f78937a520db5 | |||
6 | 42 | f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465 | 42 | f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465 |
7 | 43 | # apply pyupgrade --py3-plus to lp.snappy | 43 | # apply pyupgrade --py3-plus to lp.snappy |
8 | 44 | 2cda038936743a2f9271953c23b9fcc98968db63 | 44 | 2cda038936743a2f9271953c23b9fcc98968db63 |
9 | 45 | # apply pyupgrade --py3-plus to lp.soyuz | ||
10 | 46 | 21fb5364d9371c0ad2edf41fa6920c4e16ead2b0 | ||
11 | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml | |||
12 | index d70d934..d969ed2 100644 | |||
13 | --- a/.pre-commit-config.yaml | |||
14 | +++ b/.pre-commit-config.yaml | |||
15 | @@ -56,6 +56,7 @@ repos: | |||
16 | 56 | |scripts | 56 | |scripts |
17 | 57 | |services | 57 | |services |
18 | 58 | |snappy | 58 | |snappy |
19 | 59 | |soyuz | ||
20 | 59 | )/ | 60 | )/ |
21 | 60 | - repo: https://github.com/PyCQA/isort | 61 | - repo: https://github.com/PyCQA/isort |
22 | 61 | rev: 5.9.2 | 62 | rev: 5.9.2 |
23 | diff --git a/lib/lp/soyuz/adapters/overrides.py b/lib/lp/soyuz/adapters/overrides.py | |||
24 | index 3f93f64..f78c769 100644 | |||
25 | --- a/lib/lp/soyuz/adapters/overrides.py | |||
26 | +++ b/lib/lp/soyuz/adapters/overrides.py | |||
27 | @@ -127,7 +127,7 @@ class BinaryOverride(Override): | |||
28 | 127 | def __init__(self, component=None, section=None, priority=None, | 127 | def __init__(self, component=None, section=None, priority=None, |
29 | 128 | phased_update_percentage=None, version=None, new=None, | 128 | phased_update_percentage=None, version=None, new=None, |
30 | 129 | source_override=None): | 129 | source_override=None): |
32 | 130 | super(BinaryOverride, self).__init__( | 130 | super().__init__( |
33 | 131 | component=component, section=section, version=version, new=new) | 131 | component=component, section=section, version=version, new=new) |
34 | 132 | self.priority = priority | 132 | self.priority = priority |
35 | 133 | self.phased_update_percentage = phased_update_percentage | 133 | self.phased_update_percentage = phased_update_percentage |
36 | @@ -201,7 +201,7 @@ class BaseOverridePolicy: | |||
37 | 201 | 201 | ||
38 | 202 | def __init__(self, archive, distroseries, pocket, | 202 | def __init__(self, archive, distroseries, pocket, |
39 | 203 | phased_update_percentage=None): | 203 | phased_update_percentage=None): |
41 | 204 | super(BaseOverridePolicy, self).__init__() | 204 | super().__init__() |
42 | 205 | self.archive = archive | 205 | self.archive = archive |
43 | 206 | self.distroseries = distroseries | 206 | self.distroseries = distroseries |
44 | 207 | self.pocket = pocket | 207 | self.pocket = pocket |
45 | @@ -226,7 +226,7 @@ class FromExistingOverridePolicy(BaseOverridePolicy): | |||
46 | 226 | def __init__(self, *args, **kwargs): | 226 | def __init__(self, *args, **kwargs): |
47 | 227 | self.any_arch = kwargs.pop('any_arch', False) | 227 | self.any_arch = kwargs.pop('any_arch', False) |
48 | 228 | self.include_deleted = kwargs.pop('include_deleted', False) | 228 | self.include_deleted = kwargs.pop('include_deleted', False) |
50 | 229 | super(FromExistingOverridePolicy, self).__init__(*args, **kwargs) | 229 | super().__init__(*args, **kwargs) |
51 | 230 | 230 | ||
52 | 231 | def getExistingPublishingStatuses(self, include_deleted): | 231 | def getExistingPublishingStatuses(self, include_deleted): |
53 | 232 | status = list(active_publishing_status) | 232 | status = list(active_publishing_status) |
54 | diff --git a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
55 | index a6374a5..5f49b53 100644 | |||
56 | --- a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
57 | +++ b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
58 | @@ -139,7 +139,7 @@ class TestSourcesList(TestCaseWithFactory): | |||
59 | 139 | } | 139 | } |
60 | 140 | 140 | ||
61 | 141 | def setUp(self): | 141 | def setUp(self): |
63 | 142 | super(TestSourcesList, self).setUp() | 142 | super().setUp() |
64 | 143 | self.publisher = SoyuzTestPublisher() | 143 | self.publisher = SoyuzTestPublisher() |
65 | 144 | self.ubuntu = getUtility(IDistributionSet).getByName("ubuntu") | 144 | self.ubuntu = getUtility(IDistributionSet).getByName("ubuntu") |
66 | 145 | self.hoary = self.ubuntu.getSeries("hoary") | 145 | self.hoary = self.ubuntu.getSeries("hoary") |
67 | diff --git a/lib/lp/soyuz/adapters/tests/test_buildarch.py b/lib/lp/soyuz/adapters/tests/test_buildarch.py | |||
68 | index 1427127..50d7bc3 100644 | |||
69 | --- a/lib/lp/soyuz/adapters/tests/test_buildarch.py | |||
70 | +++ b/lib/lp/soyuz/adapters/tests/test_buildarch.py | |||
71 | @@ -17,7 +17,7 @@ from lp.testing.fixture import CaptureTimeline | |||
72 | 17 | class TestDpkgArchitectureCache(TestCase): | 17 | class TestDpkgArchitectureCache(TestCase): |
73 | 18 | 18 | ||
74 | 19 | def setUp(self): | 19 | def setUp(self): |
76 | 20 | super(TestDpkgArchitectureCache, self).setUp() | 20 | super().setUp() |
77 | 21 | self.timeline = self.useFixture(CaptureTimeline()).timeline | 21 | self.timeline = self.useFixture(CaptureTimeline()).timeline |
78 | 22 | 22 | ||
79 | 23 | def assertTimeline(self, expected_details): | 23 | def assertTimeline(self, expected_details): |
80 | diff --git a/lib/lp/soyuz/adapters/tests/test_packagelocation.py b/lib/lp/soyuz/adapters/tests/test_packagelocation.py | |||
81 | index 62ac744..3d45f14 100644 | |||
82 | --- a/lib/lp/soyuz/adapters/tests/test_packagelocation.py | |||
83 | +++ b/lib/lp/soyuz/adapters/tests/test_packagelocation.py | |||
84 | @@ -84,8 +84,8 @@ class TestPackageLocation(TestCaseWithFactory): | |||
85 | 84 | self.assertEqual([], location.packagesets) | 84 | self.assertEqual([], location.packagesets) |
86 | 85 | 85 | ||
87 | 86 | def testSetupLocationWithPackagesets(self): | 86 | def testSetupLocationWithPackagesets(self): |
90 | 87 | packageset_name1 = u"foo-packageset" | 87 | packageset_name1 = "foo-packageset" |
91 | 88 | packageset_name2 = u"bar-packageset" | 88 | packageset_name2 = "bar-packageset" |
92 | 89 | packageset1 = self.factory.makePackageset(name=packageset_name1) | 89 | packageset1 = self.factory.makePackageset(name=packageset_name1) |
93 | 90 | packageset2 = self.factory.makePackageset(name=packageset_name2) | 90 | packageset2 = self.factory.makePackageset(name=packageset_name2) |
94 | 91 | location = self.getPackageLocation( | 91 | location = self.getPackageLocation( |
95 | @@ -138,17 +138,17 @@ class TestPackageLocation(TestCaseWithFactory): | |||
96 | 138 | PackageLocationError, | 138 | PackageLocationError, |
97 | 139 | self.getPackageLocation, | 139 | self.getPackageLocation, |
98 | 140 | distribution_name='debian', | 140 | distribution_name='debian', |
100 | 141 | packageset_names=[u"unknown"]) | 141 | packageset_names=["unknown"]) |
101 | 142 | 142 | ||
102 | 143 | def test_build_package_location_when_one_packageset_unknown(self): | 143 | def test_build_package_location_when_one_packageset_unknown(self): |
103 | 144 | """Test that with one of two packagesets unknown.""" | 144 | """Test that with one of two packagesets unknown.""" |
105 | 145 | packageset_name = u"foo-packageset" | 145 | packageset_name = "foo-packageset" |
106 | 146 | self.factory.makePackageset(name=packageset_name) | 146 | self.factory.makePackageset(name=packageset_name) |
107 | 147 | self.assertRaises( | 147 | self.assertRaises( |
108 | 148 | PackageLocationError, | 148 | PackageLocationError, |
109 | 149 | self.getPackageLocation, | 149 | self.getPackageLocation, |
110 | 150 | distribution_name='debian', | 150 | distribution_name='debian', |
112 | 151 | packageset_names=[packageset_name, u"unknown"]) | 151 | packageset_names=[packageset_name, "unknown"]) |
113 | 152 | 152 | ||
114 | 153 | def testSetupLocationPPANotMatchingDistribution(self): | 153 | def testSetupLocationPPANotMatchingDistribution(self): |
115 | 154 | """`PackageLocationError` is raised when PPA does not match the | 154 | """`PackageLocationError` is raised when PPA does not match the |
116 | @@ -247,9 +247,9 @@ class TestPackageLocation(TestCaseWithFactory): | |||
117 | 247 | self.assertEqual( | 247 | self.assertEqual( |
118 | 248 | str(location_ubuntu_partner), 'ubuntu/partner: hoary-RELEASE') | 248 | str(location_ubuntu_partner), 'ubuntu/partner: hoary-RELEASE') |
119 | 249 | 249 | ||
121 | 250 | self.factory.makePackageset(name=u"foo-packageset") | 250 | self.factory.makePackageset(name="foo-packageset") |
122 | 251 | location_ubuntu_packageset = self.getPackageLocation( | 251 | location_ubuntu_packageset = self.getPackageLocation( |
124 | 252 | packageset_names=[u"foo-packageset"]) | 252 | packageset_names=["foo-packageset"]) |
125 | 253 | self.assertEqual( | 253 | self.assertEqual( |
126 | 254 | str(location_ubuntu_packageset), | 254 | str(location_ubuntu_packageset), |
127 | 255 | 'ubuntu: hoary-RELEASE [foo-packageset]') | 255 | 'ubuntu: hoary-RELEASE [foo-packageset]') |
128 | diff --git a/lib/lp/soyuz/browser/archive.py b/lib/lp/soyuz/browser/archive.py | |||
129 | index 05066a0..90c5b6e 100644 | |||
130 | --- a/lib/lp/soyuz/browser/archive.py | |||
131 | +++ b/lib/lp/soyuz/browser/archive.py | |||
132 | @@ -218,7 +218,7 @@ class DistributionArchiveURL: | |||
133 | 218 | 218 | ||
134 | 219 | @property | 219 | @property |
135 | 220 | def path(self): | 220 | def path(self): |
137 | 221 | return u"+archive/%s" % self.context.name | 221 | return "+archive/%s" % self.context.name |
138 | 222 | 222 | ||
139 | 223 | 223 | ||
140 | 224 | @implementer(ICanonicalUrlData) | 224 | @implementer(ICanonicalUrlData) |
141 | @@ -235,7 +235,7 @@ class PPAURL: | |||
142 | 235 | 235 | ||
143 | 236 | @property | 236 | @property |
144 | 237 | def path(self): | 237 | def path(self): |
146 | 238 | return u"+archive/%s/%s" % ( | 238 | return "+archive/%s/%s" % ( |
147 | 239 | self.context.distribution.name, self.context.name) | 239 | self.context.distribution.name, self.context.name) |
148 | 240 | 240 | ||
149 | 241 | 241 | ||
150 | @@ -651,7 +651,7 @@ class ArchiveViewBase(LaunchpadView, SourcesListEntriesWidget): | |||
151 | 651 | " Since this archive is private, no builds are " | 651 | " Since this archive is private, no builds are " |
152 | 652 | "being dispatched.") | 652 | "being dispatched.") |
153 | 653 | self.request.response.addNotification(structured(notification)) | 653 | self.request.response.addNotification(structured(notification)) |
155 | 654 | super(ArchiveViewBase, self).initialize() | 654 | super().initialize() |
156 | 655 | # Set properties for SourcesListEntriesWidget. | 655 | # Set properties for SourcesListEntriesWidget. |
157 | 656 | self.archive = self.context | 656 | self.archive = self.context |
158 | 657 | self.sources_list_user = self.user | 657 | self.sources_list_user = self.user |
159 | @@ -948,7 +948,7 @@ class ArchiveView(ArchiveSourcePackageListViewBase): | |||
160 | 948 | self.request.response.redirect( | 948 | self.request.response.redirect( |
161 | 949 | canonical_url(self.context.distribution)) | 949 | canonical_url(self.context.distribution)) |
162 | 950 | return | 950 | return |
164 | 951 | super(ArchiveView, self).initialize() | 951 | super().initialize() |
165 | 952 | 952 | ||
166 | 953 | @property | 953 | @property |
167 | 954 | def displayname_edit_widget(self): | 954 | def displayname_edit_widget(self): |
168 | @@ -1150,7 +1150,7 @@ class ArchiveSourceSelectionFormView(ArchiveSourcePackageListViewBase): | |||
169 | 1150 | # batched_sources) but this itself requires the current values of | 1150 | # batched_sources) but this itself requires the current values of |
170 | 1151 | # the filtering widgets. So we setup the widgets, then add the | 1151 | # the filtering widgets. So we setup the widgets, then add the |
171 | 1152 | # extra field and create its widget too. | 1152 | # extra field and create its widget too. |
173 | 1153 | super(ArchiveSourceSelectionFormView, self).setUpWidgets() | 1153 | super().setUpWidgets() |
174 | 1154 | 1154 | ||
175 | 1155 | self.form_fields += self.createSelectedSourcesField() | 1155 | self.form_fields += self.createSelectedSourcesField() |
176 | 1156 | 1156 | ||
177 | @@ -2116,12 +2116,12 @@ class ArchiveEditView(BaseArchiveEditView, EnableProcessorsMixin): | |||
178 | 2116 | 2116 | ||
179 | 2117 | See `createEnabledProcessors` method. | 2117 | See `createEnabledProcessors` method. |
180 | 2118 | """ | 2118 | """ |
182 | 2119 | super(ArchiveEditView, self).setUpFields() | 2119 | super().setUpFields() |
183 | 2120 | self.form_fields += self.createEnabledProcessors( | 2120 | self.form_fields += self.createEnabledProcessors( |
184 | 2121 | self.context.available_processors, | 2121 | self.context.available_processors, |
188 | 2122 | u"The architectures on which the archive can build. Some " | 2122 | "The architectures on which the archive can build. Some " |
189 | 2123 | u"architectures are restricted and may only be enabled or " | 2123 | "architectures are restricted and may only be enabled or " |
190 | 2124 | u"disabled by administrators.") | 2124 | "disabled by administrators.") |
191 | 2125 | 2125 | ||
192 | 2126 | def validate(self, data): | 2126 | def validate(self, data): |
193 | 2127 | if 'processors' in data: | 2127 | if 'processors' in data: |
194 | @@ -2161,7 +2161,7 @@ class ArchiveAdminView(BaseArchiveEditView, EnableProcessorsMixin): | |||
195 | 2161 | 2161 | ||
196 | 2162 | def validate_save(self, action, data): | 2162 | def validate_save(self, action, data): |
197 | 2163 | """Validate the save action on ArchiveAdminView.""" | 2163 | """Validate the save action on ArchiveAdminView.""" |
199 | 2164 | super(ArchiveAdminView, self).validate_save(action, data) | 2164 | super().validate_save(action, data) |
200 | 2165 | 2165 | ||
201 | 2166 | if data.get('private') != self.context.private: | 2166 | if data.get('private') != self.context.private: |
202 | 2167 | # The privacy is being switched. | 2167 | # The privacy is being switched. |
203 | diff --git a/lib/lp/soyuz/browser/archivepermission.py b/lib/lp/soyuz/browser/archivepermission.py | |||
204 | index 4459fc1..dde0672 100644 | |||
205 | --- a/lib/lp/soyuz/browser/archivepermission.py | |||
206 | +++ b/lib/lp/soyuz/browser/archivepermission.py | |||
207 | @@ -56,4 +56,4 @@ class ArchivePermissionURL: | |||
208 | 56 | "One of component, sourcepackagename or package set should " | 56 | "One of component, sourcepackagename or package set should " |
209 | 57 | "be set") | 57 | "be set") |
210 | 58 | 58 | ||
212 | 59 | return u"%s/%s?%s" % (perm_type, username, item) | 59 | return "%s/%s?%s" % (perm_type, username, item) |
213 | diff --git a/lib/lp/soyuz/browser/archivesubscription.py b/lib/lp/soyuz/browser/archivesubscription.py | |||
214 | index 24059a3..8cff69b 100644 | |||
215 | --- a/lib/lp/soyuz/browser/archivesubscription.py | |||
216 | +++ b/lib/lp/soyuz/browser/archivesubscription.py | |||
217 | @@ -149,7 +149,7 @@ class ArchiveSubscribersView(LaunchpadFormView): | |||
218 | 149 | canonical_url(self.context)) | 149 | canonical_url(self.context)) |
219 | 150 | return | 150 | return |
220 | 151 | 151 | ||
222 | 152 | super(ArchiveSubscribersView, self).initialize() | 152 | super().initialize() |
223 | 153 | subscription_set = getUtility(IArchiveSubscriberSet) | 153 | subscription_set = getUtility(IArchiveSubscriberSet) |
224 | 154 | self.subscriptions = subscription_set.getByArchive(self.context) | 154 | self.subscriptions = subscription_set.getByArchive(self.context) |
225 | 155 | self.batchnav = BatchNavigator( | 155 | self.batchnav = BatchNavigator( |
226 | @@ -207,7 +207,7 @@ class ArchiveSubscribersView(LaunchpadFormView): | |||
227 | 207 | self.setFieldError('date_expires', | 207 | self.setFieldError('date_expires', |
228 | 208 | "The expiry date must be in the future.") | 208 | "The expiry date must be in the future.") |
229 | 209 | 209 | ||
231 | 210 | @action(u"Add", name="add", | 210 | @action("Add", name="add", |
232 | 211 | validator="validate_new_subscription") | 211 | validator="validate_new_subscription") |
233 | 212 | def create_subscription(self, action, data): | 212 | def create_subscription(self, action, data): |
234 | 213 | """Create a subscription for the supplied user.""" | 213 | """Create a subscription for the supplied user.""" |
235 | @@ -272,7 +272,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView): | |||
236 | 272 | "The expiry date must be in the future.") | 272 | "The expiry date must be in the future.") |
237 | 273 | 273 | ||
238 | 274 | @action( | 274 | @action( |
240 | 275 | u'Save', name='update', validator="validate_update_subscription") | 275 | 'Save', name='update', validator="validate_update_subscription") |
241 | 276 | def update_subscription(self, action, data): | 276 | def update_subscription(self, action, data): |
242 | 277 | """Update the context subscription with the new data.""" | 277 | """Update the context subscription with the new data.""" |
243 | 278 | # As we present a date selection to the user for expiry, we | 278 | # As we present a date selection to the user for expiry, we |
244 | @@ -292,7 +292,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView): | |||
245 | 292 | self.context.subscriber.displayname) | 292 | self.context.subscriber.displayname) |
246 | 293 | self.request.response.addNotification(notification) | 293 | self.request.response.addNotification(notification) |
247 | 294 | 294 | ||
249 | 295 | @action(u'Revoke access', name='cancel') | 295 | @action('Revoke access', name='cancel') |
250 | 296 | def cancel_subscription(self, action, data): | 296 | def cancel_subscription(self, action, data): |
251 | 297 | """Cancel the context subscription.""" | 297 | """Cancel the context subscription.""" |
252 | 298 | self.context.cancel(self.user) | 298 | self.context.cancel(self.user) |
253 | @@ -371,7 +371,7 @@ class PersonArchiveSubscriptionView(LaunchpadView, SourcesListEntriesWidget): | |||
254 | 371 | 371 | ||
255 | 372 | def initialize(self): | 372 | def initialize(self): |
256 | 373 | """Process any posted actions.""" | 373 | """Process any posted actions.""" |
258 | 374 | super(PersonArchiveSubscriptionView, self).initialize() | 374 | super().initialize() |
259 | 375 | # Set properties for SourcesListEntriesWidget. | 375 | # Set properties for SourcesListEntriesWidget. |
260 | 376 | self.archive = self.context.archive | 376 | self.archive = self.context.archive |
261 | 377 | self.sources_list_user = self.context.subscriber | 377 | self.sources_list_user = self.context.subscriber |
262 | diff --git a/lib/lp/soyuz/browser/build.py b/lib/lp/soyuz/browser/build.py | |||
263 | index e997277..2ff61ac 100644 | |||
264 | --- a/lib/lp/soyuz/browser/build.py | |||
265 | +++ b/lib/lp/soyuz/browser/build.py | |||
266 | @@ -121,7 +121,7 @@ class BuildUrl: | |||
267 | 121 | 121 | ||
268 | 122 | @property | 122 | @property |
269 | 123 | def path(self): | 123 | def path(self): |
271 | 124 | return u"+build/%d" % self.context.id | 124 | return "+build/%d" % self.context.id |
272 | 125 | 125 | ||
273 | 126 | 126 | ||
274 | 127 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): | 127 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): |
275 | diff --git a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py | |||
276 | index 6cae515..335d278 100644 | |||
277 | --- a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py | |||
278 | +++ b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py | |||
279 | @@ -45,5 +45,5 @@ class DistroArchSeriesBinaryPackageReleaseView(LaunchpadView): | |||
280 | 45 | def phased_update_percentage(self): | 45 | def phased_update_percentage(self): |
281 | 46 | """Return the formatted phased update percentage, or empty.""" | 46 | """Return the formatted phased update percentage, or empty.""" |
282 | 47 | if self.context.phased_update_percentage is not None: | 47 | if self.context.phased_update_percentage is not None: |
285 | 48 | return u"%d%% of users" % self.context.phased_update_percentage | 48 | return "%d%% of users" % self.context.phased_update_percentage |
286 | 49 | return u"" | 49 | return "" |
287 | diff --git a/lib/lp/soyuz/browser/livefs.py b/lib/lp/soyuz/browser/livefs.py | |||
288 | index ebfc41f..5409eea 100644 | |||
289 | --- a/lib/lp/soyuz/browser/livefs.py | |||
290 | +++ b/lib/lp/soyuz/browser/livefs.py | |||
291 | @@ -191,12 +191,12 @@ class ILiveFSEditSchema(Interface): | |||
292 | 191 | 'keep_binary_files_days', | 191 | 'keep_binary_files_days', |
293 | 192 | ]) | 192 | ]) |
294 | 193 | distro_series = Choice( | 193 | distro_series = Choice( |
296 | 194 | vocabulary='BuildableDistroSeries', title=u'Distribution series') | 194 | vocabulary='BuildableDistroSeries', title='Distribution series') |
297 | 195 | metadata = Text( | 195 | metadata = Text( |
299 | 196 | title=u'Live filesystem build metadata', | 196 | title='Live filesystem build metadata', |
300 | 197 | description=( | 197 | description=( |
303 | 198 | u'A JSON dictionary of data about the image. Entries here will ' | 198 | 'A JSON dictionary of data about the image. Entries here will ' |
304 | 199 | 'be passed to the builder.')) | 199 | 'be passed to the builder.')) |
305 | 200 | 200 | ||
306 | 201 | 201 | ||
307 | 202 | class LiveFSMetadataValidatorMixin: | 202 | class LiveFSMetadataValidatorMixin: |
308 | @@ -223,7 +223,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView): | |||
309 | 223 | """See `LaunchpadView`.""" | 223 | """See `LaunchpadView`.""" |
310 | 224 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): | 224 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
311 | 225 | raise LiveFSFeatureDisabled | 225 | raise LiveFSFeatureDisabled |
313 | 226 | super(LiveFSAddView, self).initialize() | 226 | super().initialize() |
314 | 227 | 227 | ||
315 | 228 | @property | 228 | @property |
316 | 229 | def initial_values(self): | 229 | def initial_values(self): |
317 | @@ -249,7 +249,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView): | |||
318 | 249 | self.next_url = canonical_url(livefs) | 249 | self.next_url = canonical_url(livefs) |
319 | 250 | 250 | ||
320 | 251 | def validate(self, data): | 251 | def validate(self, data): |
322 | 252 | super(LiveFSAddView, self).validate(data) | 252 | super().validate(data) |
323 | 253 | owner = data.get('owner', None) | 253 | owner = data.get('owner', None) |
324 | 254 | distro_series = data['distro_series'] | 254 | distro_series = data['distro_series'] |
325 | 255 | name = data.get('name', None) | 255 | name = data.get('name', None) |
326 | @@ -330,11 +330,11 @@ class LiveFSEditView(LiveFSMetadataValidatorMixin, BaseLiveFSEditView): | |||
327 | 330 | """See `LaunchpadEditFormView`.""" | 330 | """See `LaunchpadEditFormView`.""" |
328 | 331 | if 'metadata' in data: | 331 | if 'metadata' in data: |
329 | 332 | data['metadata'] = json.loads(data['metadata']) | 332 | data['metadata'] = json.loads(data['metadata']) |
331 | 333 | super(LiveFSEditView, self).updateContextFromData( | 333 | super().updateContextFromData( |
332 | 334 | data, context=context, notify_modified=notify_modified) | 334 | data, context=context, notify_modified=notify_modified) |
333 | 335 | 335 | ||
334 | 336 | def validate(self, data): | 336 | def validate(self, data): |
336 | 337 | super(LiveFSEditView, self).validate(data) | 337 | super().validate(data) |
337 | 338 | owner = data.get('owner', None) | 338 | owner = data.get('owner', None) |
338 | 339 | distro_series = data['distro_series'] | 339 | distro_series = data['distro_series'] |
339 | 340 | name = data.get('name', None) | 340 | name = data.get('name', None) |
340 | diff --git a/lib/lp/soyuz/browser/livefsbuild.py b/lib/lp/soyuz/browser/livefsbuild.py | |||
341 | index f4b1d93..78c4f1f 100644 | |||
342 | --- a/lib/lp/soyuz/browser/livefsbuild.py | |||
343 | +++ b/lib/lp/soyuz/browser/livefsbuild.py | |||
344 | @@ -150,7 +150,7 @@ class LiveFSBuildRescoreView(LaunchpadFormView): | |||
345 | 150 | 150 | ||
346 | 151 | def __call__(self): | 151 | def __call__(self): |
347 | 152 | if self.context.can_be_rescored: | 152 | if self.context.can_be_rescored: |
349 | 153 | return super(LiveFSBuildRescoreView, self).__call__() | 153 | return super().__call__() |
350 | 154 | self.request.response.addWarningNotification( | 154 | self.request.response.addWarningNotification( |
351 | 155 | "Cannot rescore this build because it is not queued.") | 155 | "Cannot rescore this build because it is not queued.") |
352 | 156 | self.request.response.redirect(canonical_url(self.context)) | 156 | self.request.response.redirect(canonical_url(self.context)) |
353 | diff --git a/lib/lp/soyuz/browser/packagerelationship.py b/lib/lp/soyuz/browser/packagerelationship.py | |||
354 | index 9816d03..8123efc 100644 | |||
355 | --- a/lib/lp/soyuz/browser/packagerelationship.py | |||
356 | +++ b/lib/lp/soyuz/browser/packagerelationship.py | |||
357 | @@ -44,8 +44,8 @@ def relationship_builder(relationship_line, getter): | |||
358 | 44 | else: | 44 | else: |
359 | 45 | url = None | 45 | url = None |
360 | 46 | if rel['version'] is None: | 46 | if rel['version'] is None: |
363 | 47 | operator = u'' | 47 | operator = '' |
364 | 48 | version = u'' | 48 | version = '' |
365 | 49 | else: | 49 | else: |
366 | 50 | operator, version = rel['version'] | 50 | operator, version = rel['version'] |
367 | 51 | relationship_set.add(name, operator, version, url) | 51 | relationship_set.add(name, operator, version, url) |
368 | diff --git a/lib/lp/soyuz/browser/publishing.py b/lib/lp/soyuz/browser/publishing.py | |||
369 | index 86bbb19..a6d16c5 100644 | |||
370 | --- a/lib/lp/soyuz/browser/publishing.py | |||
371 | +++ b/lib/lp/soyuz/browser/publishing.py | |||
372 | @@ -58,14 +58,14 @@ class SourcePublicationURL(PublicationURLBase): | |||
373 | 58 | """Dynamic URL declaration for `ISourcePackagePublishingHistory`""" | 58 | """Dynamic URL declaration for `ISourcePackagePublishingHistory`""" |
374 | 59 | @property | 59 | @property |
375 | 60 | def path(self): | 60 | def path(self): |
377 | 61 | return u"+sourcepub/%s" % self.context.id | 61 | return "+sourcepub/%s" % self.context.id |
378 | 62 | 62 | ||
379 | 63 | 63 | ||
380 | 64 | class BinaryPublicationURL(PublicationURLBase): | 64 | class BinaryPublicationURL(PublicationURLBase): |
381 | 65 | """Dynamic URL declaration for `IBinaryPackagePublishingHistory`""" | 65 | """Dynamic URL declaration for `IBinaryPackagePublishingHistory`""" |
382 | 66 | @property | 66 | @property |
383 | 67 | def path(self): | 67 | def path(self): |
385 | 68 | return u"+binarypub/%s" % self.context.id | 68 | return "+binarypub/%s" % self.context.id |
386 | 69 | 69 | ||
387 | 70 | 70 | ||
388 | 71 | class SourcePackagePublishingHistoryNavigation(Navigation, | 71 | class SourcePackagePublishingHistoryNavigation(Navigation, |
389 | @@ -188,7 +188,7 @@ class BasePublishingRecordView(LaunchpadView): | |||
390 | 188 | """Return the removal comment or 'None provided'.""" | 188 | """Return the removal comment or 'None provided'.""" |
391 | 189 | removal_comment = self.context.removal_comment | 189 | removal_comment = self.context.removal_comment |
392 | 190 | if removal_comment is None or not removal_comment.strip(): | 190 | if removal_comment is None or not removal_comment.strip(): |
394 | 191 | removal_comment = u'None provided.' | 191 | removal_comment = 'None provided.' |
395 | 192 | 192 | ||
396 | 193 | return removal_comment | 193 | return removal_comment |
397 | 194 | 194 | ||
398 | @@ -197,8 +197,8 @@ class BasePublishingRecordView(LaunchpadView): | |||
399 | 197 | """Return the formatted phased update percentage, or empty.""" | 197 | """Return the formatted phased update percentage, or empty.""" |
400 | 198 | if (self.is_binary and | 198 | if (self.is_binary and |
401 | 199 | self.context.phased_update_percentage is not None): | 199 | self.context.phased_update_percentage is not None): |
404 | 200 | return u"%d%% of users" % self.context.phased_update_percentage | 200 | return "%d%% of users" % self.context.phased_update_percentage |
405 | 201 | return u"" | 201 | return "" |
406 | 202 | 202 | ||
407 | 203 | @property | 203 | @property |
408 | 204 | def linkify_copied_from_archive(self): | 204 | def linkify_copied_from_archive(self): |
409 | diff --git a/lib/lp/soyuz/browser/sourceslist.py b/lib/lp/soyuz/browser/sourceslist.py | |||
410 | index 29697aa..6a63a44 100644 | |||
411 | --- a/lib/lp/soyuz/browser/sourceslist.py | |||
412 | +++ b/lib/lp/soyuz/browser/sourceslist.py | |||
413 | @@ -41,7 +41,7 @@ class SourcesListEntriesView(LaunchpadView): | |||
414 | 41 | comment=None): | 41 | comment=None): |
415 | 42 | self._initially_without_selection = initially_without_selection | 42 | self._initially_without_selection = initially_without_selection |
416 | 43 | self.comment = comment | 43 | self.comment = comment |
418 | 44 | super(SourcesListEntriesView, self).__init__(context, request) | 44 | super().__init__(context, request) |
419 | 45 | 45 | ||
420 | 46 | def initialize(self): | 46 | def initialize(self): |
421 | 47 | self.terms = [] | 47 | self.terms = [] |
422 | diff --git a/lib/lp/soyuz/browser/tests/test_archive.py b/lib/lp/soyuz/browser/tests/test_archive.py | |||
423 | index 9ed6c08..07e8614 100644 | |||
424 | --- a/lib/lp/soyuz/browser/tests/test_archive.py | |||
425 | +++ b/lib/lp/soyuz/browser/tests/test_archive.py | |||
426 | @@ -58,7 +58,7 @@ class TestArchiveEditView(TestCaseWithFactory): | |||
427 | 58 | layer = LaunchpadFunctionalLayer | 58 | layer = LaunchpadFunctionalLayer |
428 | 59 | 59 | ||
429 | 60 | def setUp(self): | 60 | def setUp(self): |
431 | 61 | super(TestArchiveEditView, self).setUp() | 61 | super().setUp() |
432 | 62 | # None of the Ubuntu series in sampledata have amd64. Add it to | 62 | # None of the Ubuntu series in sampledata have amd64. Add it to |
433 | 63 | # breezy so that it shows up in the list of available processors. | 63 | # breezy so that it shows up in the list of available processors. |
434 | 64 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 64 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
435 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py | |||
436 | index aecf106..7a2abdf 100644 | |||
437 | --- a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py | |||
438 | +++ b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py | |||
439 | @@ -17,7 +17,7 @@ class TestArchivePrivacySwitchingView(TestCaseWithFactory): | |||
440 | 17 | 17 | ||
441 | 18 | def setUp(self): | 18 | def setUp(self): |
442 | 19 | """Create a ppa for the tests and login as an admin.""" | 19 | """Create a ppa for the tests and login as an admin.""" |
444 | 20 | super(TestArchivePrivacySwitchingView, self).setUp() | 20 | super().setUp() |
445 | 21 | self.ppa = self.factory.makeArchive() | 21 | self.ppa = self.factory.makeArchive() |
446 | 22 | # Login as an admin to ensure access to the view's context | 22 | # Login as an admin to ensure access to the view's context |
447 | 23 | # object. | 23 | # object. |
448 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_packages.py b/lib/lp/soyuz/browser/tests/test_archive_packages.py | |||
449 | index db5f7e2..ea6d517 100644 | |||
450 | --- a/lib/lp/soyuz/browser/tests/test_archive_packages.py | |||
451 | +++ b/lib/lp/soyuz/browser/tests/test_archive_packages.py | |||
452 | @@ -54,7 +54,7 @@ class TestP3APackages(TestCaseWithFactory): | |||
453 | 54 | layer = LaunchpadFunctionalLayer | 54 | layer = LaunchpadFunctionalLayer |
454 | 55 | 55 | ||
455 | 56 | def setUp(self): | 56 | def setUp(self): |
457 | 57 | super(TestP3APackages, self).setUp() | 57 | super().setUp() |
458 | 58 | self.private_ppa = self.factory.makeArchive(description='Foo') | 58 | self.private_ppa = self.factory.makeArchive(description='Foo') |
459 | 59 | login('admin@canonical.com') | 59 | login('admin@canonical.com') |
460 | 60 | self.private_ppa.private = True | 60 | self.private_ppa.private = True |
461 | @@ -333,7 +333,7 @@ class TestPPAPackagesJobNotifications(TestCaseWithFactory): | |||
462 | 333 | layer = LaunchpadFunctionalLayer | 333 | layer = LaunchpadFunctionalLayer |
463 | 334 | 334 | ||
464 | 335 | def setUp(self): | 335 | def setUp(self): |
466 | 336 | super(TestPPAPackagesJobNotifications, self).setUp() | 336 | super().setUp() |
467 | 337 | self.ws_version = 'devel' | 337 | self.ws_version = 'devel' |
468 | 338 | self.person = self.factory.makePerson() | 338 | self.person = self.factory.makePerson() |
469 | 339 | self.archive = self.factory.makeArchive(owner=self.person) | 339 | self.archive = self.factory.makeArchive(owner=self.person) |
470 | @@ -494,7 +494,7 @@ class TestP3APackagesQueryCount(TestCaseWithFactory): | |||
471 | 494 | layer = DatabaseFunctionalLayer | 494 | layer = DatabaseFunctionalLayer |
472 | 495 | 495 | ||
473 | 496 | def setUp(self): | 496 | def setUp(self): |
475 | 497 | super(TestP3APackagesQueryCount, self).setUp() | 497 | super().setUp() |
476 | 498 | self.team = self.factory.makeTeam() | 498 | self.team = self.factory.makeTeam() |
477 | 499 | login_person(self.team.teamowner) | 499 | login_person(self.team.teamowner) |
478 | 500 | self.person = self.factory.makePerson() | 500 | self.person = self.factory.makePerson() |
479 | diff --git a/lib/lp/soyuz/browser/tests/test_archive_webservice.py b/lib/lp/soyuz/browser/tests/test_archive_webservice.py | |||
480 | index 87a33a2..352b346 100644 | |||
481 | --- a/lib/lp/soyuz/browser/tests/test_archive_webservice.py | |||
482 | +++ b/lib/lp/soyuz/browser/tests/test_archive_webservice.py | |||
483 | @@ -49,7 +49,7 @@ class TestArchiveWebservice(TestCaseWithFactory): | |||
484 | 49 | layer = DatabaseFunctionalLayer | 49 | layer = DatabaseFunctionalLayer |
485 | 50 | 50 | ||
486 | 51 | def setUp(self): | 51 | def setUp(self): |
488 | 52 | super(TestArchiveWebservice, self).setUp() | 52 | super().setUp() |
489 | 53 | with admin_logged_in() as _admin: | 53 | with admin_logged_in() as _admin: |
490 | 54 | admin = _admin | 54 | admin = _admin |
491 | 55 | self.archive = self.factory.makeArchive( | 55 | self.archive = self.factory.makeArchive( |
492 | @@ -682,7 +682,7 @@ class TestGetPublishedBinaries(TestCaseWithFactory): | |||
493 | 682 | layer = DatabaseFunctionalLayer | 682 | layer = DatabaseFunctionalLayer |
494 | 683 | 683 | ||
495 | 684 | def setUp(self): | 684 | def setUp(self): |
497 | 685 | super(TestGetPublishedBinaries, self).setUp() | 685 | super().setUp() |
498 | 686 | self.person = self.factory.makePerson() | 686 | self.person = self.factory.makePerson() |
499 | 687 | self.archive = self.factory.makeArchive() | 687 | self.archive = self.factory.makeArchive() |
500 | 688 | self.person_url = api_url(self.person) | 688 | self.person_url = api_url(self.person) |
501 | @@ -817,7 +817,7 @@ class TestRemoveCopyNotification(TestCaseWithFactory): | |||
502 | 817 | layer = DatabaseFunctionalLayer | 817 | layer = DatabaseFunctionalLayer |
503 | 818 | 818 | ||
504 | 819 | def setUp(self): | 819 | def setUp(self): |
506 | 820 | super(TestRemoveCopyNotification, self).setUp() | 820 | super().setUp() |
507 | 821 | self.person = self.factory.makePerson() | 821 | self.person = self.factory.makePerson() |
508 | 822 | self.archive = self.factory.makeArchive(owner=self.person) | 822 | self.archive = self.factory.makeArchive(owner=self.person) |
509 | 823 | self.archive_url = api_url(self.archive) | 823 | self.archive_url = api_url(self.archive) |
510 | diff --git a/lib/lp/soyuz/browser/tests/test_archivesubscription.py b/lib/lp/soyuz/browser/tests/test_archivesubscription.py | |||
511 | index 24ecb0f..31daf54 100644 | |||
512 | --- a/lib/lp/soyuz/browser/tests/test_archivesubscription.py | |||
513 | +++ b/lib/lp/soyuz/browser/tests/test_archivesubscription.py | |||
514 | @@ -29,7 +29,7 @@ class TestArchiveSubscribersView(TestCaseWithFactory): | |||
515 | 29 | layer = LaunchpadFunctionalLayer | 29 | layer = LaunchpadFunctionalLayer |
516 | 30 | 30 | ||
517 | 31 | def setUp(self): | 31 | def setUp(self): |
519 | 32 | super(TestArchiveSubscribersView, self).setUp() | 32 | super().setUp() |
520 | 33 | self.p3a_owner = self.factory.makePerson() | 33 | self.p3a_owner = self.factory.makePerson() |
521 | 34 | admin = getUtility(IPersonSet).getByEmail('admin@canonical.com') | 34 | admin = getUtility(IPersonSet).getByEmail('admin@canonical.com') |
522 | 35 | with person_logged_in(admin): | 35 | with person_logged_in(admin): |
523 | diff --git a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py | |||
524 | index c3c1789..23875f3 100644 | |||
525 | --- a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py | |||
526 | +++ b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py | |||
527 | @@ -16,7 +16,7 @@ from lp.testing.breadcrumbs import BaseBreadcrumbTestCase | |||
528 | 16 | class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): | 16 | class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): |
529 | 17 | 17 | ||
530 | 18 | def setUp(self): | 18 | def setUp(self): |
532 | 19 | super(TestDistroArchSeriesBreadcrumb, self).setUp() | 19 | super().setUp() |
533 | 20 | self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu') | 20 | self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
534 | 21 | self.hoary = self.ubuntu.getSeries('hoary') | 21 | self.hoary = self.ubuntu.getSeries('hoary') |
535 | 22 | self.hoary_i386 = self.hoary['i386'] | 22 | self.hoary_i386 = self.hoary['i386'] |
536 | @@ -46,7 +46,7 @@ class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): | |||
537 | 46 | class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase): | 46 | class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase): |
538 | 47 | 47 | ||
539 | 48 | def setUp(self): | 48 | def setUp(self): |
541 | 49 | super(TestArchiveSubscriptionBreadcrumb, self).setUp() | 49 | super().setUp() |
542 | 50 | 50 | ||
543 | 51 | # Create a private ppa | 51 | # Create a private ppa |
544 | 52 | self.ppa = self.factory.makeArchive() | 52 | self.ppa = self.factory.makeArchive() |
545 | diff --git a/lib/lp/soyuz/browser/tests/test_build_views.py b/lib/lp/soyuz/browser/tests/test_build_views.py | |||
546 | index 02bb4a1..477a9f6 100644 | |||
547 | --- a/lib/lp/soyuz/browser/tests/test_build_views.py | |||
548 | +++ b/lib/lp/soyuz/browser/tests/test_build_views.py | |||
549 | @@ -45,7 +45,7 @@ class TestBuildViews(TestCaseWithFactory): | |||
550 | 45 | layer = LaunchpadFunctionalLayer | 45 | layer = LaunchpadFunctionalLayer |
551 | 46 | 46 | ||
552 | 47 | def setUp(self): | 47 | def setUp(self): |
554 | 48 | super(TestBuildViews, self).setUp() | 48 | super().setUp() |
555 | 49 | self.empty_request = LaunchpadTestRequest(form={}) | 49 | self.empty_request = LaunchpadTestRequest(form={}) |
556 | 50 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 50 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
557 | 51 | 51 | ||
558 | diff --git a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py | |||
559 | index c33246e..e02d995 100644 | |||
560 | --- a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py | |||
561 | +++ b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py | |||
562 | @@ -66,7 +66,7 @@ class TestDistributionSourcePackageReleaseFiles(TestCaseWithFactory): | |||
563 | 66 | layer = LaunchpadFunctionalLayer | 66 | layer = LaunchpadFunctionalLayer |
564 | 67 | 67 | ||
565 | 68 | def setUp(self): | 68 | def setUp(self): |
567 | 69 | super(TestDistributionSourcePackageReleaseFiles, self).setUp() | 69 | super().setUp() |
568 | 70 | # SourcePackageRelease itself is contextless, so wrap it in DSPR | 70 | # SourcePackageRelease itself is contextless, so wrap it in DSPR |
569 | 71 | # to give it a URL. | 71 | # to give it a URL. |
570 | 72 | spr = self.factory.makeSourcePackageRelease() | 72 | spr = self.factory.makeSourcePackageRelease() |
571 | diff --git a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py | |||
572 | index 4357b71..0e5237b 100644 | |||
573 | --- a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py | |||
574 | +++ b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py | |||
575 | @@ -17,7 +17,7 @@ class TestDistroArchSeriesView(TestCaseWithFactory): | |||
576 | 17 | 17 | ||
577 | 18 | def setUp(self): | 18 | def setUp(self): |
578 | 19 | """Create a distroarchseries for the tests and login as an admin.""" | 19 | """Create a distroarchseries for the tests and login as an admin.""" |
580 | 20 | super(TestDistroArchSeriesView, self).setUp() | 20 | super().setUp() |
581 | 21 | self.das = self.factory.makeDistroArchSeries() | 21 | self.das = self.factory.makeDistroArchSeries() |
582 | 22 | # Login as an admin to ensure access to the view's context | 22 | # Login as an admin to ensure access to the view's context |
583 | 23 | # object. | 23 | # object. |
584 | diff --git a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py | |||
585 | index b903fef..e80f847 100644 | |||
586 | --- a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py | |||
587 | +++ b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py | |||
588 | @@ -21,7 +21,7 @@ class TestDistroSourcePackageReleaseFiles(TestCaseWithFactory): | |||
589 | 21 | layer = LaunchpadFunctionalLayer | 21 | layer = LaunchpadFunctionalLayer |
590 | 22 | 22 | ||
591 | 23 | def setUp(self): | 23 | def setUp(self): |
593 | 24 | super(TestDistroSourcePackageReleaseFiles, self).setUp() | 24 | super().setUp() |
594 | 25 | # The package must be published for the page to render. | 25 | # The package must be published for the page to render. |
595 | 26 | stp = SoyuzTestPublisher() | 26 | stp = SoyuzTestPublisher() |
596 | 27 | distroseries = stp.setUpDefaultDistroSeries() | 27 | distroseries = stp.setUpDefaultDistroSeries() |
597 | diff --git a/lib/lp/soyuz/browser/tests/test_livefs.py b/lib/lp/soyuz/browser/tests/test_livefs.py | |||
598 | index af61b1e..26a020e 100644 | |||
599 | --- a/lib/lp/soyuz/browser/tests/test_livefs.py | |||
600 | +++ b/lib/lp/soyuz/browser/tests/test_livefs.py | |||
601 | @@ -66,7 +66,7 @@ class TestLiveFSNavigation(TestCaseWithFactory): | |||
602 | 66 | layer = DatabaseFunctionalLayer | 66 | layer = DatabaseFunctionalLayer |
603 | 67 | 67 | ||
604 | 68 | def setUp(self): | 68 | def setUp(self): |
606 | 69 | super(TestLiveFSNavigation, self).setUp() | 69 | super().setUp() |
607 | 70 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 70 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
608 | 71 | 71 | ||
609 | 72 | def test_canonical_url(self): | 72 | def test_canonical_url(self): |
610 | @@ -138,7 +138,7 @@ class TestLiveFSAddView(BrowserTestCase): | |||
611 | 138 | layer = DatabaseFunctionalLayer | 138 | layer = DatabaseFunctionalLayer |
612 | 139 | 139 | ||
613 | 140 | def setUp(self): | 140 | def setUp(self): |
615 | 141 | super(TestLiveFSAddView, self).setUp() | 141 | super().setUp() |
616 | 142 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 142 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
617 | 143 | self.useFixture(FakeLogger()) | 143 | self.useFixture(FakeLogger()) |
618 | 144 | self.person = self.factory.makePerson( | 144 | self.person = self.factory.makePerson( |
619 | @@ -217,7 +217,7 @@ class TestLiveFSAdminView(BrowserTestCase): | |||
620 | 217 | layer = DatabaseFunctionalLayer | 217 | layer = DatabaseFunctionalLayer |
621 | 218 | 218 | ||
622 | 219 | def setUp(self): | 219 | def setUp(self): |
624 | 220 | super(TestLiveFSAdminView, self).setUp() | 220 | super().setUp() |
625 | 221 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 221 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
626 | 222 | self.useFixture(FakeLogger()) | 222 | self.useFixture(FakeLogger()) |
627 | 223 | self.person = self.factory.makePerson( | 223 | self.person = self.factory.makePerson( |
628 | @@ -272,7 +272,7 @@ class TestLiveFSEditView(BrowserTestCase): | |||
629 | 272 | layer = DatabaseFunctionalLayer | 272 | layer = DatabaseFunctionalLayer |
630 | 273 | 273 | ||
631 | 274 | def setUp(self): | 274 | def setUp(self): |
633 | 275 | super(TestLiveFSEditView, self).setUp() | 275 | super().setUp() |
634 | 276 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 276 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
635 | 277 | self.useFixture(FakeLogger()) | 277 | self.useFixture(FakeLogger()) |
636 | 278 | self.person = self.factory.makePerson( | 278 | self.person = self.factory.makePerson( |
637 | @@ -352,7 +352,7 @@ class TestLiveFSDeleteView(BrowserTestCase): | |||
638 | 352 | layer = LaunchpadFunctionalLayer | 352 | layer = LaunchpadFunctionalLayer |
639 | 353 | 353 | ||
640 | 354 | def setUp(self): | 354 | def setUp(self): |
642 | 355 | super(TestLiveFSDeleteView, self).setUp() | 355 | super().setUp() |
643 | 356 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 356 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
644 | 357 | self.person = self.factory.makePerson( | 357 | self.person = self.factory.makePerson( |
645 | 358 | name="test-person", displayname="Test Person") | 358 | name="test-person", displayname="Test Person") |
646 | @@ -402,7 +402,7 @@ class TestLiveFSView(BrowserTestCase): | |||
647 | 402 | layer = LaunchpadFunctionalLayer | 402 | layer = LaunchpadFunctionalLayer |
648 | 403 | 403 | ||
649 | 404 | def setUp(self): | 404 | def setUp(self): |
651 | 405 | super(TestLiveFSView, self).setUp() | 405 | super().setUp() |
652 | 406 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 406 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
653 | 407 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 407 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
654 | 408 | self.distroseries = self.factory.makeDistroSeries( | 408 | self.distroseries = self.factory.makeDistroSeries( |
655 | diff --git a/lib/lp/soyuz/browser/tests/test_livefsbuild.py b/lib/lp/soyuz/browser/tests/test_livefsbuild.py | |||
656 | index 1998d10..6cd5350 100644 | |||
657 | --- a/lib/lp/soyuz/browser/tests/test_livefsbuild.py | |||
658 | +++ b/lib/lp/soyuz/browser/tests/test_livefsbuild.py | |||
659 | @@ -43,7 +43,7 @@ class TestCanonicalUrlForLiveFSBuild(TestCaseWithFactory): | |||
660 | 43 | layer = DatabaseFunctionalLayer | 43 | layer = DatabaseFunctionalLayer |
661 | 44 | 44 | ||
662 | 45 | def setUp(self): | 45 | def setUp(self): |
664 | 46 | super(TestCanonicalUrlForLiveFSBuild, self).setUp() | 46 | super().setUp() |
665 | 47 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 47 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
666 | 48 | 48 | ||
667 | 49 | def test_canonical_url(self): | 49 | def test_canonical_url(self): |
668 | @@ -68,7 +68,7 @@ class TestLiveFSBuildView(TestCaseWithFactory): | |||
669 | 68 | layer = LaunchpadFunctionalLayer | 68 | layer = LaunchpadFunctionalLayer |
670 | 69 | 69 | ||
671 | 70 | def setUp(self): | 70 | def setUp(self): |
673 | 71 | super(TestLiveFSBuildView, self).setUp() | 71 | super().setUp() |
674 | 72 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 72 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
675 | 73 | 73 | ||
676 | 74 | def test_files(self): | 74 | def test_files(self): |
677 | @@ -111,7 +111,7 @@ class TestLiveFSBuildOperations(BrowserTestCase): | |||
678 | 111 | layer = DatabaseFunctionalLayer | 111 | layer = DatabaseFunctionalLayer |
679 | 112 | 112 | ||
680 | 113 | def setUp(self): | 113 | def setUp(self): |
682 | 114 | super(TestLiveFSBuildOperations, self).setUp() | 114 | super().setUp() |
683 | 115 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 115 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
684 | 116 | self.useFixture(FakeLogger()) | 116 | self.useFixture(FakeLogger()) |
685 | 117 | self.build = self.factory.makeLiveFSBuild() | 117 | self.build = self.factory.makeLiveFSBuild() |
686 | diff --git a/lib/lp/soyuz/browser/tests/test_publishing.py b/lib/lp/soyuz/browser/tests/test_publishing.py | |||
687 | index 54ad0fc..5d67740 100644 | |||
688 | --- a/lib/lp/soyuz/browser/tests/test_publishing.py | |||
689 | +++ b/lib/lp/soyuz/browser/tests/test_publishing.py | |||
690 | @@ -40,7 +40,7 @@ class TestSourcePublicationListingExtra(BrowserTestCase): | |||
691 | 40 | layer = LaunchpadFunctionalLayer | 40 | layer = LaunchpadFunctionalLayer |
692 | 41 | 41 | ||
693 | 42 | def setUp(self): | 42 | def setUp(self): |
695 | 43 | super(TestSourcePublicationListingExtra, self).setUp() | 43 | super().setUp() |
696 | 44 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 44 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
697 | 45 | # Create everything we need to create builds, such as a | 45 | # Create everything we need to create builds, such as a |
698 | 46 | # DistroArchSeries and a builder. | 46 | # DistroArchSeries and a builder. |
699 | diff --git a/lib/lp/soyuz/browser/tests/test_queue.py b/lib/lp/soyuz/browser/tests/test_queue.py | |||
700 | index 1c8109f..012c1b0 100644 | |||
701 | --- a/lib/lp/soyuz/browser/tests/test_queue.py | |||
702 | +++ b/lib/lp/soyuz/browser/tests/test_queue.py | |||
703 | @@ -65,7 +65,7 @@ class TestAcceptRejectQueueUploads(TestCaseWithFactory): | |||
704 | 65 | def setUp(self): | 65 | def setUp(self): |
705 | 66 | """Create two new uploads in the new state and a person with | 66 | """Create two new uploads in the new state and a person with |
706 | 67 | permission to upload to the partner archive.""" | 67 | permission to upload to the partner archive.""" |
708 | 68 | super(TestAcceptRejectQueueUploads, self).setUp() | 68 | super().setUp() |
709 | 69 | login('admin@canonical.com') | 69 | login('admin@canonical.com') |
710 | 70 | self.test_publisher = SoyuzTestPublisher() | 70 | self.test_publisher = SoyuzTestPublisher() |
711 | 71 | self.test_publisher.prepareBreezyAutotest() | 71 | self.test_publisher.prepareBreezyAutotest() |
712 | diff --git a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py | |||
713 | index c0f7a87..bda8b04 100644 | |||
714 | --- a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py | |||
715 | +++ b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py | |||
716 | @@ -18,7 +18,7 @@ class TestSourcePackageReleaseView(TestCaseWithFactory): | |||
717 | 18 | layer = DatabaseFunctionalLayer | 18 | layer = DatabaseFunctionalLayer |
718 | 19 | 19 | ||
719 | 20 | def setUp(self): | 20 | def setUp(self): |
721 | 21 | super(TestSourcePackageReleaseView, self).setUp() | 21 | super().setUp() |
722 | 22 | self.source_package_release = self.factory.makeSourcePackageRelease() | 22 | self.source_package_release = self.factory.makeSourcePackageRelease() |
723 | 23 | 23 | ||
724 | 24 | def test_highlighted_copyright_is_None(self): | 24 | def test_highlighted_copyright_is_None(self): |
725 | diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py | |||
726 | index a3de895..fc7db31 100644 | |||
727 | --- a/lib/lp/soyuz/interfaces/archive.py | |||
728 | +++ b/lib/lp/soyuz/interfaces/archive.py | |||
729 | @@ -118,7 +118,7 @@ from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | |||
730 | 118 | from lp.soyuz.interfaces.component import IComponent | 118 | from lp.soyuz.interfaces.component import IComponent |
731 | 119 | 119 | ||
732 | 120 | 120 | ||
734 | 121 | NAMED_AUTH_TOKEN_FEATURE_FLAG = u"soyuz.named_auth_token.allow_new" | 121 | NAMED_AUTH_TOKEN_FEATURE_FLAG = "soyuz.named_auth_token.allow_new" |
735 | 122 | 122 | ||
736 | 123 | 123 | ||
737 | 124 | @error_status(http.client.BAD_REQUEST) | 124 | @error_status(http.client.BAD_REQUEST) |
738 | @@ -209,7 +209,7 @@ class CannotUploadToArchive(Exception): | |||
739 | 209 | 209 | ||
740 | 210 | def __init__(self, **args): | 210 | def __init__(self, **args): |
741 | 211 | """Construct a `CannotUploadToArchive`.""" | 211 | """Construct a `CannotUploadToArchive`.""" |
743 | 212 | super(CannotUploadToArchive, self).__init__(self._fmt % args) | 212 | super().__init__(self._fmt % args) |
744 | 213 | 213 | ||
745 | 214 | 214 | ||
746 | 215 | class InvalidPocketForPartnerArchive(CannotUploadToArchive): | 215 | class InvalidPocketForPartnerArchive(CannotUploadToArchive): |
747 | @@ -223,7 +223,7 @@ class CannotUploadToPocket(Exception): | |||
748 | 223 | """Returned when a pocket is closed for uploads.""" | 223 | """Returned when a pocket is closed for uploads.""" |
749 | 224 | 224 | ||
750 | 225 | def __init__(self, distroseries, pocket): | 225 | def __init__(self, distroseries, pocket): |
752 | 226 | super(CannotUploadToPocket, self).__init__( | 226 | super().__init__( |
753 | 227 | "Not permitted to upload to the %s pocket in a series in the " | 227 | "Not permitted to upload to the %s pocket in a series in the " |
754 | 228 | "'%s' state." % (pocket.name, distroseries.status.name)) | 228 | "'%s' state." % (pocket.name, distroseries.status.name)) |
755 | 229 | 229 | ||
756 | @@ -271,7 +271,7 @@ class NoRightsForComponent(CannotUploadToArchive): | |||
757 | 271 | "Signer is not permitted to upload to the component '%(component)s'.") | 271 | "Signer is not permitted to upload to the component '%(component)s'.") |
758 | 272 | 272 | ||
759 | 273 | def __init__(self, component): | 273 | def __init__(self, component): |
761 | 274 | super(NoRightsForComponent, self).__init__(component=component.name) | 274 | super().__init__(component=component.name) |
762 | 275 | 275 | ||
763 | 276 | 276 | ||
764 | 277 | class InvalidPocketForPPA(CannotUploadToArchive): | 277 | class InvalidPocketForPPA(CannotUploadToArchive): |
765 | @@ -286,7 +286,7 @@ class ArchiveDisabled(CannotUploadToArchive): | |||
766 | 286 | _fmt = ("%(archive_name)s is disabled.") | 286 | _fmt = ("%(archive_name)s is disabled.") |
767 | 287 | 287 | ||
768 | 288 | def __init__(self, archive_name): | 288 | def __init__(self, archive_name): |
770 | 289 | super(ArchiveDisabled, self).__init__(archive_name=archive_name) | 289 | super().__init__(archive_name=archive_name) |
771 | 290 | 290 | ||
772 | 291 | 291 | ||
773 | 292 | class CannotUploadToSeries(CannotUploadToArchive): | 292 | class CannotUploadToSeries(CannotUploadToArchive): |
774 | @@ -295,8 +295,7 @@ class CannotUploadToSeries(CannotUploadToArchive): | |||
775 | 295 | _fmt = ("%(distroseries)s is obsolete and will not accept new uploads.") | 295 | _fmt = ("%(distroseries)s is obsolete and will not accept new uploads.") |
776 | 296 | 296 | ||
777 | 297 | def __init__(self, distroseries): | 297 | def __init__(self, distroseries): |
780 | 298 | super(CannotUploadToSeries, self).__init__( | 298 | super().__init__(distroseries=distroseries.name) |
779 | 299 | distroseries=distroseries.name) | ||
781 | 300 | 299 | ||
782 | 301 | 300 | ||
783 | 302 | @error_status(http.client.BAD_REQUEST) | 301 | @error_status(http.client.BAD_REQUEST) |
784 | @@ -318,8 +317,7 @@ class CannotModifyArchiveProcessor(Exception): | |||
785 | 318 | 'by administrators.') | 317 | 'by administrators.') |
786 | 319 | 318 | ||
787 | 320 | def __init__(self, processor): | 319 | def __init__(self, processor): |
790 | 321 | super(CannotModifyArchiveProcessor, self).__init__( | 320 | super().__init__(self._fmt % {'processor': processor.name}) |
789 | 322 | self._fmt % {'processor': processor.name}) | ||
791 | 323 | 321 | ||
792 | 324 | 322 | ||
793 | 325 | @error_status(http.client.CONFLICT) | 323 | @error_status(http.client.CONFLICT) |
794 | @@ -333,7 +331,7 @@ class NamedAuthTokenFeatureDisabled(Unauthorized): | |||
795 | 333 | """Only certain users can create named authorization tokens.""" | 331 | """Only certain users can create named authorization tokens.""" |
796 | 334 | 332 | ||
797 | 335 | def __init__(self): | 333 | def __init__(self): |
799 | 336 | super(NamedAuthTokenFeatureDisabled, self).__init__( | 334 | super().__init__( |
800 | 337 | "You do not have permission to create named authorization tokens") | 335 | "You do not have permission to create named authorization tokens") |
801 | 338 | 336 | ||
802 | 339 | 337 | ||
803 | diff --git a/lib/lp/soyuz/interfaces/distributionjob.py b/lib/lp/soyuz/interfaces/distributionjob.py | |||
804 | index 9095f32..2ff19cd 100644 | |||
805 | --- a/lib/lp/soyuz/interfaces/distributionjob.py | |||
806 | +++ b/lib/lp/soyuz/interfaces/distributionjob.py | |||
807 | @@ -84,7 +84,7 @@ class InitializationPending(Exception): | |||
808 | 84 | """ | 84 | """ |
809 | 85 | 85 | ||
810 | 86 | def __init__(self, job): | 86 | def __init__(self, job): |
812 | 87 | super(InitializationPending, self).__init__() | 87 | super().__init__() |
813 | 88 | self.job = job | 88 | self.job = job |
814 | 89 | 89 | ||
815 | 90 | 90 | ||
816 | @@ -95,7 +95,7 @@ class InitializationCompleted(Exception): | |||
817 | 95 | """ | 95 | """ |
818 | 96 | 96 | ||
819 | 97 | def __init__(self, job): | 97 | def __init__(self, job): |
821 | 98 | super(InitializationCompleted, self).__init__() | 98 | super().__init__() |
822 | 99 | self.job = job | 99 | self.job = job |
823 | 100 | 100 | ||
824 | 101 | 101 | ||
825 | diff --git a/lib/lp/soyuz/interfaces/livefs.py b/lib/lp/soyuz/interfaces/livefs.py | |||
826 | index 5569735..db7f795 100644 | |||
827 | --- a/lib/lp/soyuz/interfaces/livefs.py | |||
828 | +++ b/lib/lp/soyuz/interfaces/livefs.py | |||
829 | @@ -73,8 +73,8 @@ from lp.soyuz.interfaces.archive import IArchive | |||
830 | 73 | from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries | 73 | from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries |
831 | 74 | 74 | ||
832 | 75 | 75 | ||
835 | 76 | LIVEFS_FEATURE_FLAG = u"soyuz.livefs.allow_new" | 76 | LIVEFS_FEATURE_FLAG = "soyuz.livefs.allow_new" |
836 | 77 | LIVEFS_WEBHOOKS_FEATURE_FLAG = u"soyuz.livefs.webhooks.enabled" | 77 | LIVEFS_WEBHOOKS_FEATURE_FLAG = "soyuz.livefs.webhooks.enabled" |
837 | 78 | 78 | ||
838 | 79 | 79 | ||
839 | 80 | @error_status(http.client.BAD_REQUEST) | 80 | @error_status(http.client.BAD_REQUEST) |
840 | @@ -82,7 +82,7 @@ class LiveFSBuildAlreadyPending(Exception): | |||
841 | 82 | """A build was requested when an identical build was already pending.""" | 82 | """A build was requested when an identical build was already pending.""" |
842 | 83 | 83 | ||
843 | 84 | def __init__(self): | 84 | def __init__(self): |
845 | 85 | super(LiveFSBuildAlreadyPending, self).__init__( | 85 | super().__init__( |
846 | 86 | "An identical build of this live filesystem image is already " | 86 | "An identical build of this live filesystem image is already " |
847 | 87 | "pending.") | 87 | "pending.") |
848 | 88 | 88 | ||
849 | @@ -100,7 +100,7 @@ class LiveFSBuildArchiveOwnerMismatch(Forbidden): | |||
850 | 100 | """ | 100 | """ |
851 | 101 | 101 | ||
852 | 102 | def __init__(self): | 102 | def __init__(self): |
854 | 103 | super(LiveFSBuildArchiveOwnerMismatch, self).__init__( | 103 | super().__init__( |
855 | 104 | "Live filesystem builds against private archives are only " | 104 | "Live filesystem builds against private archives are only " |
856 | 105 | "allowed if the live filesystem owner and the archive owner are " | 105 | "allowed if the live filesystem owner and the archive owner are " |
857 | 106 | "equal.") | 106 | "equal.") |
858 | @@ -111,7 +111,7 @@ class LiveFSFeatureDisabled(Unauthorized): | |||
859 | 111 | """Only certain users can create new LiveFS-related objects.""" | 111 | """Only certain users can create new LiveFS-related objects.""" |
860 | 112 | 112 | ||
861 | 113 | def __init__(self): | 113 | def __init__(self): |
863 | 114 | super(LiveFSFeatureDisabled, self).__init__( | 114 | super().__init__( |
864 | 115 | "You do not have permission to create new live filesystems or " | 115 | "You do not have permission to create new live filesystems or " |
865 | 116 | "new live filesystem builds.") | 116 | "new live filesystem builds.") |
866 | 117 | 117 | ||
867 | @@ -121,7 +121,7 @@ class DuplicateLiveFSName(Exception): | |||
868 | 121 | """Raised for live filesystems with duplicate name/owner/distroseries.""" | 121 | """Raised for live filesystems with duplicate name/owner/distroseries.""" |
869 | 122 | 122 | ||
870 | 123 | def __init__(self): | 123 | def __init__(self): |
872 | 124 | super(DuplicateLiveFSName, self).__init__( | 124 | super().__init__( |
873 | 125 | "There is already a live filesystem with the same name, owner, " | 125 | "There is already a live filesystem with the same name, owner, " |
874 | 126 | "and distroseries.") | 126 | "and distroseries.") |
875 | 127 | 127 | ||
876 | diff --git a/lib/lp/soyuz/interfaces/publishing.py b/lib/lp/soyuz/interfaces/publishing.py | |||
877 | index 16667a6..a1d5dc2 100644 | |||
878 | --- a/lib/lp/soyuz/interfaces/publishing.py | |||
879 | +++ b/lib/lp/soyuz/interfaces/publishing.py | |||
880 | @@ -570,8 +570,8 @@ class ISourcePackagePublishingHistoryEdit(IPublishingEdit): | |||
881 | 570 | # _schema_circular_imports.py. | 570 | # _schema_circular_imports.py. |
882 | 571 | @operation_returns_entry(Interface) | 571 | @operation_returns_entry(Interface) |
883 | 572 | @operation_parameters( | 572 | @operation_parameters( |
886 | 573 | new_component=TextLine(title=u"The new component name."), | 573 | new_component=TextLine(title="The new component name."), |
887 | 574 | new_section=TextLine(title=u"The new section name.")) | 574 | new_section=TextLine(title="The new section name.")) |
888 | 575 | @export_write_operation() | 575 | @export_write_operation() |
889 | 576 | @call_with(creator=REQUEST_USER) | 576 | @call_with(creator=REQUEST_USER) |
890 | 577 | @operation_for_version("devel") | 577 | @operation_for_version("devel") |
891 | @@ -870,15 +870,15 @@ class IBinaryPackagePublishingHistoryEdit(IPublishingEdit): | |||
892 | 870 | # _schema_circular_imports.py. | 870 | # _schema_circular_imports.py. |
893 | 871 | @operation_returns_entry(Interface) | 871 | @operation_returns_entry(Interface) |
894 | 872 | @operation_parameters( | 872 | @operation_parameters( |
897 | 873 | new_component=TextLine(title=u"The new component name."), | 873 | new_component=TextLine(title="The new component name."), |
898 | 874 | new_section=TextLine(title=u"The new section name."), | 874 | new_section=TextLine(title="The new section name."), |
899 | 875 | # XXX cjwatson 20120619: It would be nice to use copy_field here to | 875 | # XXX cjwatson 20120619: It would be nice to use copy_field here to |
900 | 876 | # save manually looking up the priority name, but it doesn't work in | 876 | # save manually looking up the priority name, but it doesn't work in |
901 | 877 | # this case: the title is wrong, and tests fail when a string value | 877 | # this case: the title is wrong, and tests fail when a string value |
902 | 878 | # is passed over the webservice. | 878 | # is passed over the webservice. |
904 | 879 | new_priority=TextLine(title=u"The new priority name."), | 879 | new_priority=TextLine(title="The new priority name."), |
905 | 880 | new_phased_update_percentage=Int( | 880 | new_phased_update_percentage=Int( |
907 | 881 | title=u"The new phased update percentage.")) | 881 | title="The new phased update percentage.")) |
908 | 882 | @export_write_operation() | 882 | @export_write_operation() |
909 | 883 | @call_with(creator=REQUEST_USER) | 883 | @call_with(creator=REQUEST_USER) |
910 | 884 | @operation_for_version("devel") | 884 | @operation_for_version("devel") |
911 | diff --git a/lib/lp/soyuz/interfaces/queue.py b/lib/lp/soyuz/interfaces/queue.py | |||
912 | index a95c982..3afd574 100644 | |||
913 | --- a/lib/lp/soyuz/interfaces/queue.py | |||
914 | +++ b/lib/lp/soyuz/interfaces/queue.py | |||
915 | @@ -475,8 +475,8 @@ class IPackageUpload(Interface): | |||
916 | 475 | """ | 475 | """ |
917 | 476 | 476 | ||
918 | 477 | @operation_parameters( | 477 | @operation_parameters( |
921 | 478 | new_component=TextLine(title=u"The new component name."), | 478 | new_component=TextLine(title="The new component name."), |
922 | 479 | new_section=TextLine(title=u"The new section name.")) | 479 | new_section=TextLine(title="The new section name.")) |
923 | 480 | @call_with(allowed_components=None, user=REQUEST_USER) | 480 | @call_with(allowed_components=None, user=REQUEST_USER) |
924 | 481 | @export_write_operation() | 481 | @export_write_operation() |
925 | 482 | @operation_for_version('devel') | 482 | @operation_for_version('devel') |
926 | @@ -505,9 +505,9 @@ class IPackageUpload(Interface): | |||
927 | 505 | 505 | ||
928 | 506 | @operation_parameters( | 506 | @operation_parameters( |
929 | 507 | changes=List( | 507 | changes=List( |
931 | 508 | title=u"A sequence of changes to apply.", | 508 | title="A sequence of changes to apply.", |
932 | 509 | description=( | 509 | description=( |
934 | 510 | u"Each item may have a 'name' item which specifies the binary " | 510 | "Each item may have a 'name' item which specifies the binary " |
935 | 511 | "package name to override; otherwise, the change applies to " | 511 | "package name to override; otherwise, the change applies to " |
936 | 512 | "all binaries in the upload. It may also have 'component', " | 512 | "all binaries in the upload. It may also have 'component', " |
937 | 513 | "'section', and 'priority' items which replace the " | 513 | "'section', and 'priority' items which replace the " |
938 | diff --git a/lib/lp/soyuz/mail/binarypackagebuild.py b/lib/lp/soyuz/mail/binarypackagebuild.py | |||
939 | index 4f3eb4f..225c16e 100644 | |||
940 | --- a/lib/lp/soyuz/mail/binarypackagebuild.py | |||
941 | +++ b/lib/lp/soyuz/mail/binarypackagebuild.py | |||
942 | @@ -61,8 +61,7 @@ class BinaryPackageBuildRecipientReason(RecipientReason): | |||
943 | 61 | 61 | ||
944 | 62 | def getReason(self): | 62 | def getReason(self): |
945 | 63 | """See `RecipientReason`.""" | 63 | """See `RecipientReason`.""" |
948 | 64 | return MailWrapper(width=72).format( | 64 | return MailWrapper(width=72).format(super().getReason()) |
947 | 65 | super(BinaryPackageBuildRecipientReason, self).getReason()) | ||
949 | 66 | 65 | ||
950 | 67 | 66 | ||
951 | 68 | class BinaryPackageBuildMailer(BaseMailer): | 67 | class BinaryPackageBuildMailer(BaseMailer): |
952 | @@ -143,7 +142,7 @@ class BinaryPackageBuildMailer(BaseMailer): | |||
953 | 143 | 142 | ||
954 | 144 | def __init__(self, subject, template_name, recipients, from_address, | 143 | def __init__(self, subject, template_name, recipients, from_address, |
955 | 145 | build, extra_info=None): | 144 | build, extra_info=None): |
957 | 146 | super(BinaryPackageBuildMailer, self).__init__( | 145 | super().__init__( |
958 | 147 | subject, template_name, recipients, from_address, | 146 | subject, template_name, recipients, from_address, |
959 | 148 | notification_type="package-build-status") | 147 | notification_type="package-build-status") |
960 | 149 | self.build = build | 148 | self.build = build |
961 | @@ -151,8 +150,7 @@ class BinaryPackageBuildMailer(BaseMailer): | |||
962 | 151 | 150 | ||
963 | 152 | def _getHeaders(self, email, recipient): | 151 | def _getHeaders(self, email, recipient): |
964 | 153 | """See `BaseMailer`.""" | 152 | """See `BaseMailer`.""" |
967 | 154 | headers = super(BinaryPackageBuildMailer, self)._getHeaders( | 153 | headers = super()._getHeaders(email, recipient) |
966 | 155 | email, recipient) | ||
968 | 156 | build = self.build | 154 | build = self.build |
969 | 157 | headers.update({ | 155 | headers.update({ |
970 | 158 | "X-Launchpad-Archive": build.archive.reference, | 156 | "X-Launchpad-Archive": build.archive.reference, |
971 | @@ -169,13 +167,12 @@ class BinaryPackageBuildMailer(BaseMailer): | |||
972 | 169 | # The deprecated PPA reference header is included for Ubuntu PPAs to | 167 | # The deprecated PPA reference header is included for Ubuntu PPAs to |
973 | 170 | # avoid breaking existing consumers. | 168 | # avoid breaking existing consumers. |
974 | 171 | if (build.archive.is_ppa and | 169 | if (build.archive.is_ppa and |
976 | 172 | build.archive.distribution.name == u'ubuntu'): | 170 | build.archive.distribution.name == 'ubuntu'): |
977 | 173 | headers["X-Launchpad-PPA"] = get_ppa_reference(build.archive) | 171 | headers["X-Launchpad-PPA"] = get_ppa_reference(build.archive) |
978 | 174 | return headers | 172 | return headers |
979 | 175 | 173 | ||
980 | 176 | def _getTemplateParams(self, email, recipient): | 174 | def _getTemplateParams(self, email, recipient): |
983 | 177 | params = super(BinaryPackageBuildMailer, self)._getTemplateParams( | 175 | params = super()._getTemplateParams(email, recipient) |
982 | 178 | email, recipient) | ||
984 | 179 | build = self.build | 176 | build = self.build |
985 | 180 | extra_info = self.extra_info | 177 | extra_info = self.extra_info |
986 | 181 | 178 | ||
987 | diff --git a/lib/lp/soyuz/mail/livefsbuild.py b/lib/lp/soyuz/mail/livefsbuild.py | |||
988 | index f907884..6bfa5e2 100644 | |||
989 | --- a/lib/lp/soyuz/mail/livefsbuild.py | |||
990 | +++ b/lib/lp/soyuz/mail/livefsbuild.py | |||
991 | @@ -33,22 +33,21 @@ class LiveFSBuildMailer(BaseMailer): | |||
992 | 33 | 33 | ||
993 | 34 | def __init__(self, subject, template_name, recipients, from_address, | 34 | def __init__(self, subject, template_name, recipients, from_address, |
994 | 35 | build): | 35 | build): |
996 | 36 | super(LiveFSBuildMailer, self).__init__( | 36 | super().__init__( |
997 | 37 | subject, template_name, recipients, from_address, | 37 | subject, template_name, recipients, from_address, |
998 | 38 | notification_type="livefs-build-status") | 38 | notification_type="livefs-build-status") |
999 | 39 | self.build = build | 39 | self.build = build |
1000 | 40 | 40 | ||
1001 | 41 | def _getHeaders(self, email, recipient): | 41 | def _getHeaders(self, email, recipient): |
1002 | 42 | """See `BaseMailer`.""" | 42 | """See `BaseMailer`.""" |
1004 | 43 | headers = super(LiveFSBuildMailer, self)._getHeaders(email, recipient) | 43 | headers = super()._getHeaders(email, recipient) |
1005 | 44 | headers["X-Launchpad-Build-State"] = self.build.status.name | 44 | headers["X-Launchpad-Build-State"] = self.build.status.name |
1006 | 45 | return headers | 45 | return headers |
1007 | 46 | 46 | ||
1008 | 47 | def _getTemplateParams(self, email, recipient): | 47 | def _getTemplateParams(self, email, recipient): |
1009 | 48 | """See `BaseMailer`.""" | 48 | """See `BaseMailer`.""" |
1010 | 49 | build = self.build | 49 | build = self.build |
1013 | 50 | params = super(LiveFSBuildMailer, self)._getTemplateParams( | 50 | params = super()._getTemplateParams(email, recipient) |
1012 | 51 | email, recipient) | ||
1014 | 52 | params.update({ | 51 | params.update({ |
1015 | 53 | "archive_tag": build.archive.reference, | 52 | "archive_tag": build.archive.reference, |
1016 | 54 | "build_id": build.id, | 53 | "build_id": build.id, |
1017 | diff --git a/lib/lp/soyuz/mail/packageupload.py b/lib/lp/soyuz/mail/packageupload.py | |||
1018 | index 053a052..8224ebf 100644 | |||
1019 | --- a/lib/lp/soyuz/mail/packageupload.py | |||
1020 | +++ b/lib/lp/soyuz/mail/packageupload.py | |||
1021 | @@ -81,8 +81,7 @@ class PackageUploadRecipientReason(RecipientReason): | |||
1022 | 81 | return cls(recipient, recipient, "Announcement", "") | 81 | return cls(recipient, recipient, "Announcement", "") |
1023 | 82 | 82 | ||
1024 | 83 | def _getTemplateValues(self): | 83 | def _getTemplateValues(self): |
1027 | 84 | template_values = super( | 84 | template_values = super()._getTemplateValues() |
1026 | 85 | PackageUploadRecipientReason, self)._getTemplateValues() | ||
1028 | 86 | template_values["lc_entity_has"] = "you have" | 85 | template_values["lc_entity_has"] = "you have" |
1029 | 87 | if self.recipient != self.subscriber or self.subscriber.is_team: | 86 | if self.recipient != self.subscriber or self.subscriber.is_team: |
1030 | 88 | template_values["lc_entity_has"] = ( | 87 | template_values["lc_entity_has"] = ( |
1031 | @@ -92,7 +91,7 @@ class PackageUploadRecipientReason(RecipientReason): | |||
1032 | 92 | def getReason(self): | 91 | def getReason(self): |
1033 | 93 | """See `RecipientReason`.""" | 92 | """See `RecipientReason`.""" |
1034 | 94 | return MailWrapper(width=72).format( | 93 | return MailWrapper(width=72).format( |
1036 | 95 | super(PackageUploadRecipientReason, self).getReason()) | 94 | super().getReason()) |
1037 | 96 | 95 | ||
1038 | 97 | 96 | ||
1039 | 98 | def debug(logger, msg, *args, **kwargs): | 97 | def debug(logger, msg, *args, **kwargs): |
1040 | @@ -110,7 +109,7 @@ def sanitize_string(s): | |||
1041 | 110 | 'ascii' codec can't decode byte 0xc4 in position 21: ordinal | 109 | 'ascii' codec can't decode byte 0xc4 in position 21: ordinal |
1042 | 111 | not in range(128) | 110 | not in range(128) |
1043 | 112 | """ | 111 | """ |
1045 | 113 | if isinstance(s, six.text_type): | 112 | if isinstance(s, str): |
1046 | 114 | return s | 113 | return s |
1047 | 115 | else: | 114 | else: |
1048 | 116 | return guess_encoding(s) | 115 | return guess_encoding(s) |
1049 | @@ -447,7 +446,7 @@ class PackageUploadMailer(BaseMailer): | |||
1050 | 447 | distroseries, pocket, summary_text=None, changes=None, | 446 | distroseries, pocket, summary_text=None, changes=None, |
1051 | 448 | changesfile_content=None, announce_from_address=None, | 447 | changesfile_content=None, announce_from_address=None, |
1052 | 449 | previous_version=None, logger=None): | 448 | previous_version=None, logger=None): |
1054 | 450 | super(PackageUploadMailer, self).__init__( | 449 | super().__init__( |
1055 | 451 | subject, template_name, recipients, from_address, | 450 | subject, template_name, recipients, from_address, |
1056 | 452 | notification_type="package-upload") | 451 | notification_type="package-upload") |
1057 | 453 | self.action = action | 452 | self.action = action |
1058 | @@ -480,19 +479,17 @@ class PackageUploadMailer(BaseMailer): | |||
1059 | 480 | self.announce_from_address is not None): | 479 | self.announce_from_address is not None): |
1060 | 481 | return self.announce_from_address | 480 | return self.announce_from_address |
1061 | 482 | else: | 481 | else: |
1064 | 483 | return super(PackageUploadMailer, self)._getFromAddress( | 482 | return super()._getFromAddress(email, recipient) |
1063 | 484 | email, recipient) | ||
1065 | 485 | 483 | ||
1066 | 486 | def _getHeaders(self, email, recipient): | 484 | def _getHeaders(self, email, recipient): |
1067 | 487 | """See `BaseMailer`.""" | 485 | """See `BaseMailer`.""" |
1070 | 488 | headers = super(PackageUploadMailer, self)._getHeaders( | 486 | headers = super()._getHeaders(email, recipient) |
1069 | 489 | email, recipient) | ||
1071 | 490 | headers['X-Katie'] = 'Launchpad actually' | 487 | headers['X-Katie'] = 'Launchpad actually' |
1072 | 491 | headers['X-Launchpad-Archive'] = self.archive.reference | 488 | headers['X-Launchpad-Archive'] = self.archive.reference |
1073 | 492 | 489 | ||
1074 | 493 | # The deprecated PPA reference header is included for Ubuntu PPAs to | 490 | # The deprecated PPA reference header is included for Ubuntu PPAs to |
1075 | 494 | # avoid breaking existing consumers. | 491 | # avoid breaking existing consumers. |
1077 | 495 | if self.archive.is_ppa and self.archive.distribution.name == u'ubuntu': | 492 | if self.archive.is_ppa and self.archive.distribution.name == 'ubuntu': |
1078 | 496 | headers['X-Launchpad-PPA'] = get_ppa_reference(self.archive) | 493 | headers['X-Launchpad-PPA'] = get_ppa_reference(self.archive) |
1079 | 497 | 494 | ||
1080 | 498 | # Include a 'X-Launchpad-Component' header with the component and | 495 | # Include a 'X-Launchpad-Component' header with the component and |
1081 | @@ -541,8 +538,7 @@ class PackageUploadMailer(BaseMailer): | |||
1082 | 541 | 538 | ||
1083 | 542 | def _getTemplateParams(self, email, recipient): | 539 | def _getTemplateParams(self, email, recipient): |
1084 | 543 | """See `BaseMailer`.""" | 540 | """See `BaseMailer`.""" |
1087 | 544 | params = super(PackageUploadMailer, self)._getTemplateParams( | 541 | params = super()._getTemplateParams(email, recipient) |
1086 | 545 | email, recipient) | ||
1088 | 546 | params.update({ | 542 | params.update({ |
1089 | 547 | 'STATUS': ACTION_DESCRIPTIONS[self.action], | 543 | 'STATUS': ACTION_DESCRIPTIONS[self.action], |
1090 | 548 | 'SUMMARY': self.summarystring, | 544 | 'SUMMARY': self.summarystring, |
1091 | @@ -612,7 +608,7 @@ class PackageUploadMailer(BaseMailer): | |||
1092 | 612 | 608 | ||
1093 | 613 | def generateEmail(self, email, recipient, force_no_attachments=False): | 609 | def generateEmail(self, email, recipient, force_no_attachments=False): |
1094 | 614 | """See `BaseMailer`.""" | 610 | """See `BaseMailer`.""" |
1096 | 615 | ctrl = super(PackageUploadMailer, self).generateEmail( | 611 | ctrl = super().generateEmail( |
1097 | 616 | email, recipient, force_no_attachments=force_no_attachments) | 612 | email, recipient, force_no_attachments=force_no_attachments) |
1098 | 617 | debug(self.logger, "Sent a mail:") | 613 | debug(self.logger, "Sent a mail:") |
1099 | 618 | debug(self.logger, " Subject: %s" % ctrl.subject) | 614 | debug(self.logger, " Subject: %s" % ctrl.subject) |
1100 | diff --git a/lib/lp/soyuz/mail/tests/test_packageupload.py b/lib/lp/soyuz/mail/tests/test_packageupload.py | |||
1101 | index 2dc2a7a..ae539e2 100644 | |||
1102 | --- a/lib/lp/soyuz/mail/tests/test_packageupload.py | |||
1103 | +++ b/lib/lp/soyuz/mail/tests/test_packageupload.py | |||
1104 | @@ -48,14 +48,14 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): | |||
1105 | 48 | def test_mail_from_unicode_names(self): | 48 | def test_mail_from_unicode_names(self): |
1106 | 49 | # People with unicode in their names should appear correctly in the | 49 | # People with unicode in their names should appear correctly in the |
1107 | 50 | # email and not get smashed to ASCII or otherwise transliterated. | 50 | # email and not get smashed to ASCII or otherwise transliterated. |
1109 | 51 | creator = self.factory.makePerson(displayname=u"LoĆÆc") | 51 | creator = self.factory.makePerson(displayname="LoĆÆc") |
1110 | 52 | spr = self.factory.makeSourcePackageRelease(creator=creator) | 52 | spr = self.factory.makeSourcePackageRelease(creator=creator) |
1111 | 53 | self.factory.makeSourcePackageReleaseFile(sourcepackagerelease=spr) | 53 | self.factory.makeSourcePackageReleaseFile(sourcepackagerelease=spr) |
1112 | 54 | archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY) | 54 | archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY) |
1113 | 55 | pocket = PackagePublishingPocket.RELEASE | 55 | pocket = PackagePublishingPocket.RELEASE |
1114 | 56 | distroseries = self.factory.makeDistroSeries() | 56 | distroseries = self.factory.makeDistroSeries() |
1115 | 57 | distroseries.changeslist = "blah@example.com" | 57 | distroseries.changeslist = "blah@example.com" |
1117 | 58 | blamer = self.factory.makePerson(displayname=u"StƩphane") | 58 | blamer = self.factory.makePerson(displayname="StƩphane") |
1118 | 59 | mailer = PackageUploadMailer.forAction( | 59 | mailer = PackageUploadMailer.forAction( |
1119 | 60 | "accepted", blamer, spr, [], [], archive, distroseries, pocket) | 60 | "accepted", blamer, spr, [], [], archive, distroseries, pocket) |
1120 | 61 | mailer.sendAll() | 61 | mailer.sendAll() |
1121 | @@ -63,8 +63,8 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): | |||
1122 | 63 | self.assertEqual(2, len(notifications)) | 63 | self.assertEqual(2, len(notifications)) |
1123 | 64 | msg = notifications[1].get_payload(0) | 64 | msg = notifications[1].get_payload(0) |
1124 | 65 | body = six.ensure_text(msg.get_payload(decode=True)) | 65 | body = six.ensure_text(msg.get_payload(decode=True)) |
1127 | 66 | self.assertIn(u"Changed-By: LoĆÆc", body) | 66 | self.assertIn("Changed-By: LoĆÆc", body) |
1128 | 67 | self.assertIn(u"Signed-By: StƩphane", body) | 67 | self.assertIn("Signed-By: StƩphane", body) |
1129 | 68 | 68 | ||
1130 | 69 | def test_calculate_subject_customfile(self): | 69 | def test_calculate_subject_customfile(self): |
1131 | 70 | lfa = self.factory.makeLibraryFileAlias() | 70 | lfa = self.factory.makeLibraryFileAlias() |
1132 | @@ -143,7 +143,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): | |||
1133 | 143 | distroseries.changeslist = "blah@example.com" | 143 | distroseries.changeslist = "blah@example.com" |
1134 | 144 | blamer = self.factory.makePerson() | 144 | blamer = self.factory.makePerson() |
1135 | 145 | from_person = self.factory.makePerson( | 145 | from_person = self.factory.makePerson( |
1137 | 146 | email="loic@example.com", displayname=u"LoĆÆc Motƶrhead") | 146 | email="loic@example.com", displayname="LoĆÆc Motƶrhead") |
1138 | 147 | mailer = PackageUploadMailer.forAction( | 147 | mailer = PackageUploadMailer.forAction( |
1139 | 148 | "accepted", blamer, spr, [], [], archive, distroseries, pocket, | 148 | "accepted", blamer, spr, [], [], archive, distroseries, pocket, |
1140 | 149 | announce_from_person=from_person) | 149 | announce_from_person=from_person) |
1141 | @@ -215,7 +215,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory): | |||
1142 | 215 | pocket = self.factory.getAnyPocket() | 215 | pocket = self.factory.getAnyPocket() |
1143 | 216 | distroseries = self.factory.makeDistroSeries() | 216 | distroseries = self.factory.makeDistroSeries() |
1144 | 217 | person = self.factory.makePerson( | 217 | person = self.factory.makePerson( |
1146 | 218 | displayname=u'Blamer', email='blamer@example.com') | 218 | displayname='Blamer', email='blamer@example.com') |
1147 | 219 | mailer = PackageUploadMailer.forAction( | 219 | mailer = PackageUploadMailer.forAction( |
1148 | 220 | "rejected", person, None, [bpr], [], archive, distroseries, pocket, | 220 | "rejected", person, None, [bpr], [], archive, distroseries, pocket, |
1149 | 221 | summary_text="Rejected by archive administrator.") | 221 | summary_text="Rejected by archive administrator.") |
1150 | @@ -262,7 +262,7 @@ class TestNotification(TestCaseWithFactory): | |||
1151 | 262 | info['maintainer'], | 262 | info['maintainer'], |
1152 | 263 | ] | 263 | ] |
1153 | 264 | for field in fields: | 264 | for field in fields: |
1155 | 265 | self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field) | 265 | self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field) |
1156 | 266 | self.assertFalse(info['notify_changed_by']) | 266 | self.assertFalse(info['notify_changed_by']) |
1157 | 267 | 267 | ||
1158 | 268 | def test_fetch_information_changes_notify_changed_by(self): | 268 | def test_fetch_information_changes_notify_changed_by(self): |
1159 | @@ -281,21 +281,21 @@ class TestNotification(TestCaseWithFactory): | |||
1160 | 281 | info['maintainer'], | 281 | info['maintainer'], |
1161 | 282 | ] | 282 | ] |
1162 | 283 | for field in fields: | 283 | for field in fields: |
1164 | 284 | self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field) | 284 | self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field) |
1165 | 285 | self.assertTrue(info['notify_changed_by']) | 285 | self.assertTrue(info['notify_changed_by']) |
1166 | 286 | 286 | ||
1167 | 287 | def test_fetch_information_spr(self): | 287 | def test_fetch_information_spr(self): |
1170 | 288 | creator = self.factory.makePerson(displayname=u"foĆø") | 288 | creator = self.factory.makePerson(displayname="foĆø") |
1171 | 289 | maintainer = self.factory.makePerson(displayname=u"bƦr") | 289 | maintainer = self.factory.makePerson(displayname="bƦr") |
1172 | 290 | spr = self.factory.makeSourcePackageRelease( | 290 | spr = self.factory.makeSourcePackageRelease( |
1173 | 291 | creator=creator, maintainer=maintainer) | 291 | creator=creator, maintainer=maintainer) |
1174 | 292 | info = fetch_information(spr, None, None) | 292 | info = fetch_information(spr, None, None) |
1175 | 293 | self.assertEqual(info['date'], spr.dateuploaded) | 293 | self.assertEqual(info['date'], spr.dateuploaded) |
1176 | 294 | self.assertEqual(info['changelog'], spr.changelog_entry) | 294 | self.assertEqual(info['changelog'], spr.changelog_entry) |
1177 | 295 | self.assertEqual( | 295 | self.assertEqual( |
1179 | 296 | (u"foĆø", spr.creator.preferredemail.email), info['changedby']) | 296 | ("foĆø", spr.creator.preferredemail.email), info['changedby']) |
1180 | 297 | self.assertEqual( | 297 | self.assertEqual( |
1182 | 298 | (u"bƦr", spr.maintainer.preferredemail.email), info['maintainer']) | 298 | ("bƦr", spr.maintainer.preferredemail.email), info['maintainer']) |
1183 | 299 | self.assertFalse(info['notify_changed_by']) | 299 | self.assertFalse(info['notify_changed_by']) |
1184 | 300 | 300 | ||
1185 | 301 | def test_fetch_information_bprs(self): | 301 | def test_fetch_information_bprs(self): |
1186 | diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py | |||
1187 | index 50ed7aa..b3c7798 100644 | |||
1188 | --- a/lib/lp/soyuz/model/archive.py | |||
1189 | +++ b/lib/lp/soyuz/model/archive.py | |||
1190 | @@ -230,10 +230,10 @@ from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease | |||
1191 | 230 | 230 | ||
1192 | 231 | 231 | ||
1193 | 232 | ARCHIVE_REFERENCE_TEMPLATES = { | 232 | ARCHIVE_REFERENCE_TEMPLATES = { |
1198 | 233 | ArchivePurpose.PRIMARY: u'%(distribution)s', | 233 | ArchivePurpose.PRIMARY: '%(distribution)s', |
1199 | 234 | ArchivePurpose.PPA: u'~%(owner)s/%(distribution)s/%(archive)s', | 234 | ArchivePurpose.PPA: '~%(owner)s/%(distribution)s/%(archive)s', |
1200 | 235 | ArchivePurpose.PARTNER: u'%(distribution)s/%(archive)s', | 235 | ArchivePurpose.PARTNER: '%(distribution)s/%(archive)s', |
1201 | 236 | ArchivePurpose.COPY: u'%(distribution)s/%(archive)s', | 236 | ArchivePurpose.COPY: '%(distribution)s/%(archive)s', |
1202 | 237 | } | 237 | } |
1203 | 238 | 238 | ||
1204 | 239 | 239 | ||
1205 | @@ -617,7 +617,7 @@ class Archive(SQLBase): | |||
1206 | 617 | SourcePackageName.id) | 617 | SourcePackageName.id) |
1207 | 618 | 618 | ||
1208 | 619 | if name is not None: | 619 | if name is not None: |
1210 | 620 | if isinstance(name, six.string_types): | 620 | if isinstance(name, str): |
1211 | 621 | if exact_match: | 621 | if exact_match: |
1212 | 622 | clauses.append(SourcePackageName.name == name) | 622 | clauses.append(SourcePackageName.name == name) |
1213 | 623 | else: | 623 | else: |
1214 | @@ -1162,7 +1162,7 @@ class Archive(SQLBase): | |||
1215 | 1162 | 1162 | ||
1216 | 1163 | def _addArchiveDependency(self, dependency, pocket, component=None): | 1163 | def _addArchiveDependency(self, dependency, pocket, component=None): |
1217 | 1164 | """See `IArchive`.""" | 1164 | """See `IArchive`.""" |
1219 | 1165 | if isinstance(component, six.string_types): | 1165 | if isinstance(component, str): |
1220 | 1166 | try: | 1166 | try: |
1221 | 1167 | component = getUtility(IComponentSet)[component] | 1167 | component = getUtility(IComponentSet)[component] |
1222 | 1168 | except NotFoundError as e: | 1168 | except NotFoundError as e: |
1223 | @@ -1417,9 +1417,9 @@ class Archive(SQLBase): | |||
1224 | 1417 | def _checkUpload(self, person, distroseries, sourcepackagename, component, | 1417 | def _checkUpload(self, person, distroseries, sourcepackagename, component, |
1225 | 1418 | pocket, strict_component=True): | 1418 | pocket, strict_component=True): |
1226 | 1419 | """See `IArchive`.""" | 1419 | """See `IArchive`.""" |
1228 | 1420 | if isinstance(component, six.string_types): | 1420 | if isinstance(component, str): |
1229 | 1421 | component = getUtility(IComponentSet)[component] | 1421 | component = getUtility(IComponentSet)[component] |
1231 | 1422 | if isinstance(sourcepackagename, six.string_types): | 1422 | if isinstance(sourcepackagename, str): |
1232 | 1423 | sourcepackagename = getUtility( | 1423 | sourcepackagename = getUtility( |
1233 | 1424 | ISourcePackageNameSet)[sourcepackagename] | 1424 | ISourcePackageNameSet)[sourcepackagename] |
1234 | 1425 | reason = self.checkUpload(person, distroseries, sourcepackagename, | 1425 | reason = self.checkUpload(person, distroseries, sourcepackagename, |
1235 | @@ -1534,7 +1534,7 @@ class Archive(SQLBase): | |||
1236 | 1534 | if self.is_ppa: | 1534 | if self.is_ppa: |
1237 | 1535 | if IComponent.providedBy(component_name): | 1535 | if IComponent.providedBy(component_name): |
1238 | 1536 | name = component_name.name | 1536 | name = component_name.name |
1240 | 1537 | elif isinstance(component_name, six.string_types): | 1537 | elif isinstance(component_name, str): |
1241 | 1538 | name = component_name | 1538 | name = component_name |
1242 | 1539 | else: | 1539 | else: |
1243 | 1540 | name = None | 1540 | name = None |
1244 | @@ -1970,7 +1970,7 @@ class Archive(SQLBase): | |||
1245 | 1970 | reason = self.checkUploadToPocket(series, pocket, person=person) | 1970 | reason = self.checkUploadToPocket(series, pocket, person=person) |
1246 | 1971 | if reason: | 1971 | if reason: |
1247 | 1972 | # Wrap any forbidden-pocket error in CannotCopy. | 1972 | # Wrap any forbidden-pocket error in CannotCopy. |
1249 | 1973 | raise CannotCopy(six.text_type(reason)) | 1973 | raise CannotCopy(str(reason)) |
1250 | 1974 | 1974 | ||
1251 | 1975 | # Perform the copy, may raise CannotCopy. Don't do any further | 1975 | # Perform the copy, may raise CannotCopy. Don't do any further |
1252 | 1976 | # permission checking: this method is protected by | 1976 | # permission checking: this method is protected by |
1253 | @@ -2536,14 +2536,14 @@ class ArchiveSet: | |||
1254 | 2536 | """See `IArchiveSet`.""" | 2536 | """See `IArchiveSet`.""" |
1255 | 2537 | from lp.registry.interfaces.distribution import IDistributionSet | 2537 | from lp.registry.interfaces.distribution import IDistributionSet |
1256 | 2538 | 2538 | ||
1258 | 2539 | bits = reference.split(u'/') | 2539 | bits = reference.split('/') |
1259 | 2540 | if len(bits) < 1: | 2540 | if len(bits) < 1: |
1260 | 2541 | return None | 2541 | return None |
1262 | 2542 | if bits[0].startswith(u'~') or bits[0].startswith(u'ppa:'): | 2542 | if bits[0].startswith('~') or bits[0].startswith('ppa:'): |
1263 | 2543 | # PPA reference (~OWNER/DISTRO/ARCHIVE or ppa:OWNER/DISTRO/ARCHIVE) | 2543 | # PPA reference (~OWNER/DISTRO/ARCHIVE or ppa:OWNER/DISTRO/ARCHIVE) |
1264 | 2544 | if len(bits) != 3: | 2544 | if len(bits) != 3: |
1265 | 2545 | return None | 2545 | return None |
1267 | 2546 | if bits[0].startswith(u'~'): | 2546 | if bits[0].startswith('~'): |
1268 | 2547 | first_bit = bits[0][1:] | 2547 | first_bit = bits[0][1:] |
1269 | 2548 | else: | 2548 | else: |
1270 | 2549 | # ppa:OWNER | 2549 | # ppa:OWNER |
1271 | diff --git a/lib/lp/soyuz/model/archivedependency.py b/lib/lp/soyuz/model/archivedependency.py | |||
1272 | index f880077..5f7b63c 100644 | |||
1273 | --- a/lib/lp/soyuz/model/archivedependency.py | |||
1274 | +++ b/lib/lp/soyuz/model/archivedependency.py | |||
1275 | @@ -53,7 +53,7 @@ class ArchiveDependency(StormBase): | |||
1276 | 53 | component = Reference(component_id, 'Component.id') | 53 | component = Reference(component_id, 'Component.id') |
1277 | 54 | 54 | ||
1278 | 55 | def __init__(self, parent, dependency, pocket, component=None): | 55 | def __init__(self, parent, dependency, pocket, component=None): |
1280 | 56 | super(ArchiveDependency, self).__init__() | 56 | super().__init__() |
1281 | 57 | self.parent = parent | 57 | self.parent = parent |
1282 | 58 | self.dependency = dependency | 58 | self.dependency = dependency |
1283 | 59 | self.pocket = pocket | 59 | self.pocket = pocket |
1284 | diff --git a/lib/lp/soyuz/model/archivefile.py b/lib/lp/soyuz/model/archivefile.py | |||
1285 | index e6b126d..8f4075a 100644 | |||
1286 | --- a/lib/lp/soyuz/model/archivefile.py | |||
1287 | +++ b/lib/lp/soyuz/model/archivefile.py | |||
1288 | @@ -66,7 +66,7 @@ class ArchiveFile(Storm): | |||
1289 | 66 | 66 | ||
1290 | 67 | def __init__(self, archive, container, path, library_file): | 67 | def __init__(self, archive, container, path, library_file): |
1291 | 68 | """Construct an `ArchiveFile`.""" | 68 | """Construct an `ArchiveFile`.""" |
1293 | 69 | super(ArchiveFile, self).__init__() | 69 | super().__init__() |
1294 | 70 | self.archive = archive | 70 | self.archive = archive |
1295 | 71 | self.container = container | 71 | self.container = container |
1296 | 72 | self.path = path | 72 | self.path = path |
1297 | diff --git a/lib/lp/soyuz/model/archivejob.py b/lib/lp/soyuz/model/archivejob.py | |||
1298 | index 3dcaff2..e6785c6 100644 | |||
1299 | --- a/lib/lp/soyuz/model/archivejob.py | |||
1300 | +++ b/lib/lp/soyuz/model/archivejob.py | |||
1301 | @@ -66,7 +66,7 @@ class ArchiveJob(StormBase): | |||
1302 | 66 | :param metadata: the type-specific variables, as a json-compatible | 66 | :param metadata: the type-specific variables, as a json-compatible |
1303 | 67 | dict. | 67 | dict. |
1304 | 68 | """ | 68 | """ |
1306 | 69 | super(ArchiveJob, self).__init__() | 69 | super().__init__() |
1307 | 70 | self.job = Job() | 70 | self.job = Job() |
1308 | 71 | self.archive = archive | 71 | self.archive = archive |
1309 | 72 | self.job_type = job_type | 72 | self.job_type = job_type |
1310 | @@ -103,7 +103,7 @@ class ArchiveJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): | |||
1311 | 103 | 103 | ||
1312 | 104 | def getOopsVars(self): | 104 | def getOopsVars(self): |
1313 | 105 | """See `IRunnableJob`.""" | 105 | """See `IRunnableJob`.""" |
1315 | 106 | vars = super(ArchiveJobDerived, self).getOopsVars() | 106 | vars = super().getOopsVars() |
1316 | 107 | vars.extend([ | 107 | vars.extend([ |
1317 | 108 | ('archive_id', self.context.archive.id), | 108 | ('archive_id', self.context.archive.id), |
1318 | 109 | ('archive_job_id', self.context.id), | 109 | ('archive_job_id', self.context.id), |
1319 | @@ -128,12 +128,11 @@ class PackageUploadNotificationJob(ArchiveJobDerived): | |||
1320 | 128 | 'packageupload_status': packageupload.status.title, | 128 | 'packageupload_status': packageupload.status.title, |
1321 | 129 | 'summary_text': summary_text, | 129 | 'summary_text': summary_text, |
1322 | 130 | } | 130 | } |
1325 | 131 | return super(PackageUploadNotificationJob, cls).create( | 131 | return super().create(packageupload.archive, metadata) |
1324 | 132 | packageupload.archive, metadata) | ||
1326 | 133 | 132 | ||
1327 | 134 | def getOopsVars(self): | 133 | def getOopsVars(self): |
1328 | 135 | """See `ArchiveJobDerived`.""" | 134 | """See `ArchiveJobDerived`.""" |
1330 | 136 | vars = super(PackageUploadNotificationJob, self).getOopsVars() | 135 | vars = super().getOopsVars() |
1331 | 137 | vars.extend([ | 136 | vars.extend([ |
1332 | 138 | ('packageupload_id', self.metadata['packageupload_id']), | 137 | ('packageupload_id', self.metadata['packageupload_id']), |
1333 | 139 | ('packageupload_status', self.metadata['packageupload_status']), | 138 | ('packageupload_status', self.metadata['packageupload_status']), |
1334 | diff --git a/lib/lp/soyuz/model/archivepermission.py b/lib/lp/soyuz/model/archivepermission.py | |||
1335 | index 7c816ec..8c06b7c 100644 | |||
1336 | --- a/lib/lp/soyuz/model/archivepermission.py | |||
1337 | +++ b/lib/lp/soyuz/model/archivepermission.py | |||
1338 | @@ -12,7 +12,6 @@ from operator import attrgetter | |||
1339 | 12 | 12 | ||
1340 | 13 | from lazr.enum import DBItem | 13 | from lazr.enum import DBItem |
1341 | 14 | import pytz | 14 | import pytz |
1342 | 15 | import six | ||
1343 | 16 | from storm.expr import Exists | 15 | from storm.expr import Exists |
1344 | 17 | from storm.locals import ( | 16 | from storm.locals import ( |
1345 | 18 | And, | 17 | And, |
1346 | @@ -106,7 +105,7 @@ class ArchivePermission(StormBase): | |||
1347 | 106 | def __init__(self, archive, permission, person, component=None, | 105 | def __init__(self, archive, permission, person, component=None, |
1348 | 107 | sourcepackagename=None, packageset=None, explicit=False, | 106 | sourcepackagename=None, packageset=None, explicit=False, |
1349 | 108 | distroseries=None, pocket=None): | 107 | distroseries=None, pocket=None): |
1351 | 109 | super(ArchivePermission, self).__init__() | 108 | super().__init__() |
1352 | 110 | self.archive = archive | 109 | self.archive = archive |
1353 | 111 | self.permission = permission | 110 | self.permission = permission |
1354 | 112 | self.person = person | 111 | self.person = person |
1355 | @@ -202,7 +201,7 @@ class ArchivePermissionSet: | |||
1356 | 202 | def _nameToComponent(self, component): | 201 | def _nameToComponent(self, component): |
1357 | 203 | """Helper to convert a possible string component to IComponent""" | 202 | """Helper to convert a possible string component to IComponent""" |
1358 | 204 | try: | 203 | try: |
1360 | 205 | if isinstance(component, six.string_types): | 204 | if isinstance(component, str): |
1361 | 206 | component = getUtility(IComponentSet)[component] | 205 | component = getUtility(IComponentSet)[component] |
1362 | 207 | return component | 206 | return component |
1363 | 208 | except NotFoundError: | 207 | except NotFoundError: |
1364 | @@ -210,7 +209,7 @@ class ArchivePermissionSet: | |||
1365 | 210 | 209 | ||
1366 | 211 | def _nameToSourcePackageName(self, sourcepackagename): | 210 | def _nameToSourcePackageName(self, sourcepackagename): |
1367 | 212 | """Helper to convert a possible string name to ISourcePackageName.""" | 211 | """Helper to convert a possible string name to ISourcePackageName.""" |
1369 | 213 | if isinstance(sourcepackagename, six.string_types): | 212 | if isinstance(sourcepackagename, str): |
1370 | 214 | sourcepackagename = getUtility( | 213 | sourcepackagename = getUtility( |
1371 | 215 | ISourcePackageNameSet)[sourcepackagename] | 214 | ISourcePackageNameSet)[sourcepackagename] |
1372 | 216 | return sourcepackagename | 215 | return sourcepackagename |
1373 | diff --git a/lib/lp/soyuz/model/binaryandsourcepackagename.py b/lib/lp/soyuz/model/binaryandsourcepackagename.py | |||
1374 | index 566beb7..aa09d28 100644 | |||
1375 | --- a/lib/lp/soyuz/model/binaryandsourcepackagename.py | |||
1376 | +++ b/lib/lp/soyuz/model/binaryandsourcepackagename.py | |||
1377 | @@ -58,5 +58,4 @@ class BinaryAndSourcePackageNameVocabulary(NamedStormHugeVocabulary): | |||
1378 | 58 | def getTermByToken(self, token): | 58 | def getTermByToken(self, token): |
1379 | 59 | """See `IVocabularyTokenized`.""" | 59 | """See `IVocabularyTokenized`.""" |
1380 | 60 | # package names are always lowercase. | 60 | # package names are always lowercase. |
1383 | 61 | super_class = super(BinaryAndSourcePackageNameVocabulary, self) | 61 | return super().getTermByToken(token.lower()) |
1382 | 62 | return super_class.getTermByToken(token.lower()) | ||
1384 | diff --git a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py | |||
1385 | index fc94d9a..fd6bd96 100644 | |||
1386 | --- a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py | |||
1387 | +++ b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py | |||
1388 | @@ -152,8 +152,7 @@ class BinaryPackageBuildBehaviour(BuildFarmJobBehaviourBase): | |||
1389 | 152 | das = build.distro_arch_series | 152 | das = build.distro_arch_series |
1390 | 153 | 153 | ||
1391 | 154 | # Build extra arguments. | 154 | # Build extra arguments. |
1394 | 155 | args = yield super(BinaryPackageBuildBehaviour, self).extraBuildArgs( | 155 | args = yield super().extraBuildArgs(logger=logger) |
1393 | 156 | logger=logger) | ||
1395 | 157 | args['arch_indep'] = build.arch_indep | 156 | args['arch_indep'] = build.arch_indep |
1396 | 158 | args['distribution'] = das.distroseries.distribution.name | 157 | args['distribution'] = das.distroseries.distribution.name |
1397 | 159 | args['suite'] = das.distroseries.getSuite(build.pocket) | 158 | args['suite'] = das.distroseries.getSuite(build.pocket) |
1398 | diff --git a/lib/lp/soyuz/model/binarypackagename.py b/lib/lp/soyuz/model/binarypackagename.py | |||
1399 | index 90a7cae..fc2af72 100644 | |||
1400 | --- a/lib/lp/soyuz/model/binarypackagename.py | |||
1401 | +++ b/lib/lp/soyuz/model/binarypackagename.py | |||
1402 | @@ -25,7 +25,6 @@ from lp.soyuz.interfaces.binarypackagename import ( | |||
1403 | 25 | from lp.soyuz.interfaces.publishing import active_publishing_status | 25 | from lp.soyuz.interfaces.publishing import active_publishing_status |
1404 | 26 | 26 | ||
1405 | 27 | 27 | ||
1406 | 28 | @six.python_2_unicode_compatible | ||
1407 | 29 | @implementer(IBinaryPackageName) | 28 | @implementer(IBinaryPackageName) |
1408 | 30 | class BinaryPackageName(SQLBase): | 29 | class BinaryPackageName(SQLBase): |
1409 | 31 | _table = 'BinaryPackageName' | 30 | _table = 'BinaryPackageName' |
1410 | diff --git a/lib/lp/soyuz/model/binarypackagerelease.py b/lib/lp/soyuz/model/binarypackagerelease.py | |||
1411 | index 0421e81..7baebb0 100644 | |||
1412 | --- a/lib/lp/soyuz/model/binarypackagerelease.py | |||
1413 | +++ b/lib/lp/soyuz/model/binarypackagerelease.py | |||
1414 | @@ -92,7 +92,7 @@ class BinaryPackageRelease(SQLBase): | |||
1415 | 92 | kwargs['_user_defined_fields'] = simplejson.dumps( | 92 | kwargs['_user_defined_fields'] = simplejson.dumps( |
1416 | 93 | kwargs['user_defined_fields']) | 93 | kwargs['user_defined_fields']) |
1417 | 94 | del kwargs['user_defined_fields'] | 94 | del kwargs['user_defined_fields'] |
1419 | 95 | super(BinaryPackageRelease, self).__init__(*args, **kwargs) | 95 | super().__init__(*args, **kwargs) |
1420 | 96 | 96 | ||
1421 | 97 | @cachedproperty | 97 | @cachedproperty |
1422 | 98 | def built_using_references(self): | 98 | def built_using_references(self): |
1423 | @@ -183,7 +183,7 @@ class BinaryPackageReleaseDownloadCount(Storm): | |||
1424 | 183 | count = Int(allow_none=False) | 183 | count = Int(allow_none=False) |
1425 | 184 | 184 | ||
1426 | 185 | def __init__(self, archive, binary_package_release, day, country, count): | 185 | def __init__(self, archive, binary_package_release, day, country, count): |
1428 | 186 | super(BinaryPackageReleaseDownloadCount, self).__init__() | 186 | super().__init__() |
1429 | 187 | self.archive = archive | 187 | self.archive = archive |
1430 | 188 | self.binary_package_release = binary_package_release | 188 | self.binary_package_release = binary_package_release |
1431 | 189 | self.day = day | 189 | self.day = day |
1432 | diff --git a/lib/lp/soyuz/model/binarysourcereference.py b/lib/lp/soyuz/model/binarysourcereference.py | |||
1433 | index f5f4cde..653419a 100644 | |||
1434 | --- a/lib/lp/soyuz/model/binarysourcereference.py | |||
1435 | +++ b/lib/lp/soyuz/model/binarysourcereference.py | |||
1436 | @@ -53,7 +53,7 @@ class BinarySourceReference(StormBase): | |||
1437 | 53 | def __init__(self, binary_package_release, source_package_release, | 53 | def __init__(self, binary_package_release, source_package_release, |
1438 | 54 | reference_type): | 54 | reference_type): |
1439 | 55 | """Construct a `BinarySourceReference`.""" | 55 | """Construct a `BinarySourceReference`.""" |
1441 | 56 | super(BinarySourceReference, self).__init__() | 56 | super().__init__() |
1442 | 57 | self.binary_package_release = binary_package_release | 57 | self.binary_package_release = binary_package_release |
1443 | 58 | self.source_package_release = source_package_release | 58 | self.source_package_release = source_package_release |
1444 | 59 | self.reference_type = reference_type | 59 | self.reference_type = reference_type |
1445 | diff --git a/lib/lp/soyuz/model/distributionjob.py b/lib/lp/soyuz/model/distributionjob.py | |||
1446 | index 2fb9da3..1c302bf 100644 | |||
1447 | --- a/lib/lp/soyuz/model/distributionjob.py | |||
1448 | +++ b/lib/lp/soyuz/model/distributionjob.py | |||
1449 | @@ -54,7 +54,7 @@ class DistributionJob(StormBase): | |||
1450 | 54 | metadata = JSON('json_data') | 54 | metadata = JSON('json_data') |
1451 | 55 | 55 | ||
1452 | 56 | def __init__(self, distribution, distroseries, job_type, metadata): | 56 | def __init__(self, distribution, distroseries, job_type, metadata): |
1454 | 57 | super(DistributionJob, self).__init__() | 57 | super().__init__() |
1455 | 58 | self.job = Job() | 58 | self.job = Job() |
1456 | 59 | self.distribution = distribution | 59 | self.distribution = distribution |
1457 | 60 | self.distroseries = distroseries | 60 | self.distroseries = distroseries |
1458 | @@ -100,7 +100,7 @@ class DistributionJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): | |||
1459 | 100 | 100 | ||
1460 | 101 | def getOopsVars(self): | 101 | def getOopsVars(self): |
1461 | 102 | """See `IRunnableJob`.""" | 102 | """See `IRunnableJob`.""" |
1463 | 103 | vars = super(DistributionJobDerived, self).getOopsVars() | 103 | vars = super().getOopsVars() |
1464 | 104 | vars.extend([ | 104 | vars.extend([ |
1465 | 105 | ('distribution_id', self.context.distribution.id), | 105 | ('distribution_id', self.context.distribution.id), |
1466 | 106 | ('distroseries_id', self.context.distroseries.id), | 106 | ('distroseries_id', self.context.distroseries.id), |
1467 | diff --git a/lib/lp/soyuz/model/distroarchseriesfilter.py b/lib/lp/soyuz/model/distroarchseriesfilter.py | |||
1468 | index 13e6007..948aed5 100644 | |||
1469 | --- a/lib/lp/soyuz/model/distroarchseriesfilter.py | |||
1470 | +++ b/lib/lp/soyuz/model/distroarchseriesfilter.py | |||
1471 | @@ -69,7 +69,7 @@ class DistroArchSeriesFilter(Storm): | |||
1472 | 69 | def __init__(self, distroarchseries, packageset, sense, creator, | 69 | def __init__(self, distroarchseries, packageset, sense, creator, |
1473 | 70 | date_created=DEFAULT): | 70 | date_created=DEFAULT): |
1474 | 71 | """Construct a `DistroArchSeriesFilter`.""" | 71 | """Construct a `DistroArchSeriesFilter`.""" |
1476 | 72 | super(DistroArchSeriesFilter, self).__init__() | 72 | super().__init__() |
1477 | 73 | self.distroarchseries = distroarchseries | 73 | self.distroarchseries = distroarchseries |
1478 | 74 | self.packageset = packageset | 74 | self.packageset = packageset |
1479 | 75 | self.sense = sense | 75 | self.sense = sense |
1480 | diff --git a/lib/lp/soyuz/model/initializedistroseriesjob.py b/lib/lp/soyuz/model/initializedistroseriesjob.py | |||
1481 | index 0af6d13..dd10c81 100644 | |||
1482 | --- a/lib/lp/soyuz/model/initializedistroseriesjob.py | |||
1483 | +++ b/lib/lp/soyuz/model/initializedistroseriesjob.py | |||
1484 | @@ -5,7 +5,6 @@ __all__ = [ | |||
1485 | 5 | "InitializeDistroSeriesJob", | 5 | "InitializeDistroSeriesJob", |
1486 | 6 | ] | 6 | ] |
1487 | 7 | 7 | ||
1488 | 8 | import six | ||
1489 | 9 | from zope.interface import ( | 8 | from zope.interface import ( |
1490 | 10 | implementer, | 9 | implementer, |
1491 | 11 | provider, | 10 | provider, |
1492 | @@ -216,12 +215,12 @@ class InitializeDistroSeriesJob(DistributionJobDerived): | |||
1493 | 216 | """ | 215 | """ |
1494 | 217 | # This method is called when error is an instance of | 216 | # This method is called when error is an instance of |
1495 | 218 | # self.user_error_types. | 217 | # self.user_error_types. |
1497 | 219 | super(InitializeDistroSeriesJob, self).notifyUserError(error) | 218 | super().notifyUserError(error) |
1498 | 220 | self.metadata = dict( | 219 | self.metadata = dict( |
1500 | 221 | self.metadata, error_description=six.text_type(error)) | 220 | self.metadata, error_description=str(error)) |
1501 | 222 | 221 | ||
1502 | 223 | def getOopsVars(self): | 222 | def getOopsVars(self): |
1503 | 224 | """See `IRunnableJob`.""" | 223 | """See `IRunnableJob`.""" |
1505 | 225 | vars = super(InitializeDistroSeriesJob, self).getOopsVars() | 224 | vars = super().getOopsVars() |
1506 | 226 | vars.append(('parent_distroseries_ids', self.metadata.get("parents"))) | 225 | vars.append(('parent_distroseries_ids', self.metadata.get("parents"))) |
1507 | 227 | return vars | 226 | return vars |
1508 | diff --git a/lib/lp/soyuz/model/livefs.py b/lib/lp/soyuz/model/livefs.py | |||
1509 | index 84e765f..ae3a92f 100644 | |||
1510 | --- a/lib/lp/soyuz/model/livefs.py | |||
1511 | +++ b/lib/lp/soyuz/model/livefs.py | |||
1512 | @@ -133,7 +133,7 @@ class LiveFS(Storm, WebhookTargetMixin): | |||
1513 | 133 | """Construct a `LiveFS`.""" | 133 | """Construct a `LiveFS`.""" |
1514 | 134 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): | 134 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
1515 | 135 | raise LiveFSFeatureDisabled | 135 | raise LiveFSFeatureDisabled |
1517 | 136 | super(LiveFS, self).__init__() | 136 | super().__init__() |
1518 | 137 | self.registrant = registrant | 137 | self.registrant = registrant |
1519 | 138 | self.owner = owner | 138 | self.owner = owner |
1520 | 139 | self.distro_series = distro_series | 139 | self.distro_series = distro_series |
1521 | diff --git a/lib/lp/soyuz/model/livefsbuild.py b/lib/lp/soyuz/model/livefsbuild.py | |||
1522 | index 7ec3e87..79865ec 100644 | |||
1523 | --- a/lib/lp/soyuz/model/livefsbuild.py | |||
1524 | +++ b/lib/lp/soyuz/model/livefsbuild.py | |||
1525 | @@ -92,7 +92,7 @@ class LiveFSFile(Storm): | |||
1526 | 92 | 92 | ||
1527 | 93 | def __init__(self, livefsbuild, libraryfile): | 93 | def __init__(self, livefsbuild, libraryfile): |
1528 | 94 | """Construct a `LiveFSFile`.""" | 94 | """Construct a `LiveFSFile`.""" |
1530 | 95 | super(LiveFSFile, self).__init__() | 95 | super().__init__() |
1531 | 96 | self.livefsbuild = livefsbuild | 96 | self.livefsbuild = livefsbuild |
1532 | 97 | self.libraryfile = libraryfile | 97 | self.libraryfile = libraryfile |
1533 | 98 | 98 | ||
1534 | @@ -163,7 +163,7 @@ class LiveFSBuild(PackageBuildMixin, Storm): | |||
1535 | 163 | """Construct a `LiveFSBuild`.""" | 163 | """Construct a `LiveFSBuild`.""" |
1536 | 164 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): | 164 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
1537 | 165 | raise LiveFSFeatureDisabled | 165 | raise LiveFSFeatureDisabled |
1539 | 166 | super(LiveFSBuild, self).__init__() | 166 | super().__init__() |
1540 | 167 | self.build_farm_job = build_farm_job | 167 | self.build_farm_job = build_farm_job |
1541 | 168 | self.requester = requester | 168 | self.requester = requester |
1542 | 169 | self.livefs = livefs | 169 | self.livefs = livefs |
1543 | @@ -303,7 +303,7 @@ class LiveFSBuild(PackageBuildMixin, Storm): | |||
1544 | 303 | 303 | ||
1545 | 304 | edited_fields = set() | 304 | edited_fields = set() |
1546 | 305 | with notify_modified(self, edited_fields) as previous_obj: | 305 | with notify_modified(self, edited_fields) as previous_obj: |
1548 | 306 | super(LiveFSBuild, self).updateStatus( | 306 | super().updateStatus( |
1549 | 307 | status, builder=builder, slave_status=slave_status, | 307 | status, builder=builder, slave_status=slave_status, |
1550 | 308 | date_started=date_started, date_finished=date_finished, | 308 | date_started=date_started, date_finished=date_finished, |
1551 | 309 | force_invalid_transition=force_invalid_transition) | 309 | force_invalid_transition=force_invalid_transition) |
1552 | diff --git a/lib/lp/soyuz/model/livefsbuildbehaviour.py b/lib/lp/soyuz/model/livefsbuildbehaviour.py | |||
1553 | index 700e5c0..510d17c 100644 | |||
1554 | --- a/lib/lp/soyuz/model/livefsbuildbehaviour.py | |||
1555 | +++ b/lib/lp/soyuz/model/livefsbuildbehaviour.py | |||
1556 | @@ -92,8 +92,7 @@ class LiveFSBuildBehaviour(BuildFarmJobBehaviourBase): | |||
1557 | 92 | Return the extra arguments required by the slave for the given build. | 92 | Return the extra arguments required by the slave for the given build. |
1558 | 93 | """ | 93 | """ |
1559 | 94 | build = self.build | 94 | build = self.build |
1562 | 95 | base_args = yield super(LiveFSBuildBehaviour, self).extraBuildArgs( | 95 | base_args = yield super().extraBuildArgs(logger=logger) |
1561 | 96 | logger=logger) | ||
1563 | 97 | # Non-trivial metadata values may have been security-wrapped, which | 96 | # Non-trivial metadata values may have been security-wrapped, which |
1564 | 98 | # is pointless here and just gets in the way of xmlrpc.client | 97 | # is pointless here and just gets in the way of xmlrpc.client |
1565 | 99 | # serialisation. | 98 | # serialisation. |
1566 | diff --git a/lib/lp/soyuz/model/packagecopyjob.py b/lib/lp/soyuz/model/packagecopyjob.py | |||
1567 | index f3a91a8..a3ede41 100644 | |||
1568 | --- a/lib/lp/soyuz/model/packagecopyjob.py | |||
1569 | +++ b/lib/lp/soyuz/model/packagecopyjob.py | |||
1570 | @@ -145,7 +145,7 @@ class PackageCopyJob(StormBase): | |||
1571 | 145 | def __init__(self, source_archive, target_archive, target_distroseries, | 145 | def __init__(self, source_archive, target_archive, target_distroseries, |
1572 | 146 | job_type, metadata, requester, package_name=None, | 146 | job_type, metadata, requester, package_name=None, |
1573 | 147 | copy_policy=None): | 147 | copy_policy=None): |
1575 | 148 | super(PackageCopyJob, self).__init__() | 148 | super().__init__() |
1576 | 149 | self.job = Job() | 149 | self.job = Job() |
1577 | 150 | self.job.requester = requester | 150 | self.job.requester = requester |
1578 | 151 | self.job_type = job_type | 151 | self.job_type = job_type |
1579 | @@ -228,7 +228,7 @@ class PackageCopyJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): | |||
1580 | 228 | 228 | ||
1581 | 229 | def getOopsVars(self): | 229 | def getOopsVars(self): |
1582 | 230 | """See `IRunnableJob`.""" | 230 | """See `IRunnableJob`.""" |
1584 | 231 | vars = super(PackageCopyJobDerived, self).getOopsVars() | 231 | vars = super().getOopsVars() |
1585 | 232 | vars.extend([ | 232 | vars.extend([ |
1586 | 233 | ('source_archive_id', self.context.source_archive_id), | 233 | ('source_archive_id', self.context.source_archive_id), |
1587 | 234 | ('target_archive_id', self.context.target_archive_id), | 234 | ('target_archive_id', self.context.target_archive_id), |
1588 | @@ -581,7 +581,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): | |||
1589 | 581 | " package. It was logged with id %s. Sorry for the" | 581 | " package. It was logged with id %s. Sorry for the" |
1590 | 582 | " inconvenience." % oops["id"]) | 582 | " inconvenience." % oops["id"]) |
1591 | 583 | transaction.commit() | 583 | transaction.commit() |
1593 | 584 | super(PlainPackageCopyJob, self).notifyOops(oops) | 584 | super().notifyOops(oops) |
1594 | 585 | 585 | ||
1595 | 586 | @property | 586 | @property |
1596 | 587 | def _advisory_lock_id(self): | 587 | def _advisory_lock_id(self): |
1597 | @@ -624,7 +624,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): | |||
1598 | 624 | target_archive_purpose = self.target_archive.purpose | 624 | target_archive_purpose = self.target_archive.purpose |
1599 | 625 | self.logger.info("Job:\n%s\nraised CannotCopy:\n%s" % (self, e)) | 625 | self.logger.info("Job:\n%s\nraised CannotCopy:\n%s" % (self, e)) |
1600 | 626 | self.abort() # Abort the txn. | 626 | self.abort() # Abort the txn. |
1602 | 627 | self.reportFailure(six.text_type(e)) | 627 | self.reportFailure(str(e)) |
1603 | 628 | 628 | ||
1604 | 629 | # If there is an associated PackageUpload we need to reject it, | 629 | # If there is an associated PackageUpload we need to reject it, |
1605 | 630 | # else it will sit in ACCEPTED forever. | 630 | # else it will sit in ACCEPTED forever. |
1606 | @@ -663,7 +663,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived): | |||
1607 | 663 | person=self.requester) | 663 | person=self.requester) |
1608 | 664 | if reason: | 664 | if reason: |
1609 | 665 | # Wrap any forbidden-pocket error in CannotCopy. | 665 | # Wrap any forbidden-pocket error in CannotCopy. |
1611 | 666 | raise CannotCopy(six.text_type(reason)) | 666 | raise CannotCopy(str(reason)) |
1612 | 667 | 667 | ||
1613 | 668 | if self.silent and not self.requester_can_admin_target: | 668 | if self.silent and not self.requester_can_admin_target: |
1614 | 669 | raise CannotCopy( | 669 | raise CannotCopy( |
1615 | diff --git a/lib/lp/soyuz/model/packagediff.py b/lib/lp/soyuz/model/packagediff.py | |||
1616 | index c9ad7a3..90d2170 100644 | |||
1617 | --- a/lib/lp/soyuz/model/packagediff.py | |||
1618 | +++ b/lib/lp/soyuz/model/packagediff.py | |||
1619 | @@ -15,7 +15,6 @@ import shutil | |||
1620 | 15 | import subprocess | 15 | import subprocess |
1621 | 16 | import tempfile | 16 | import tempfile |
1622 | 17 | 17 | ||
1623 | 18 | import six | ||
1624 | 19 | from storm.expr import Desc | 18 | from storm.expr import Desc |
1625 | 20 | from storm.store import EmptyResultSet | 19 | from storm.store import EmptyResultSet |
1626 | 21 | from zope.component import getUtility | 20 | from zope.component import getUtility |
1627 | @@ -215,7 +214,7 @@ class PackageDiff(SQLBase): | |||
1628 | 215 | zip(directions, (self.from_source, self.to_source))) | 214 | zip(directions, (self.from_source, self.to_source))) |
1629 | 216 | 215 | ||
1630 | 217 | # Iterate over the packages to be diff'ed. | 216 | # Iterate over the packages to be diff'ed. |
1632 | 218 | for direction, package in six.iteritems(packages): | 217 | for direction, package in packages.items(): |
1633 | 219 | # Create distinct directory locations for | 218 | # Create distinct directory locations for |
1634 | 220 | # 'from' and 'to' files. | 219 | # 'from' and 'to' files. |
1635 | 221 | absolute_path = os.path.join(tmp_dir, direction) | 220 | absolute_path = os.path.join(tmp_dir, direction) |
1636 | diff --git a/lib/lp/soyuz/model/packageset.py b/lib/lp/soyuz/model/packageset.py | |||
1637 | index 1aea015..d135b97 100644 | |||
1638 | --- a/lib/lp/soyuz/model/packageset.py | |||
1639 | +++ b/lib/lp/soyuz/model/packageset.py | |||
1640 | @@ -299,7 +299,7 @@ class Packageset(Storm): | |||
1641 | 299 | 299 | ||
1642 | 300 | def addSources(self, names): | 300 | def addSources(self, names): |
1643 | 301 | """See `IPackageset`.""" | 301 | """See `IPackageset`.""" |
1645 | 302 | if isinstance(names, six.string_types): | 302 | if isinstance(names, str): |
1646 | 303 | names = [six.ensure_text(names, 'ASCII')] | 303 | names = [six.ensure_text(names, 'ASCII')] |
1647 | 304 | clauses = (SourcePackageName, SourcePackageName.name.is_in(names)) | 304 | clauses = (SourcePackageName, SourcePackageName.name.is_in(names)) |
1648 | 305 | self._api_add_or_remove(clauses, self._addSourcePackageNames) | 305 | self._api_add_or_remove(clauses, self._addSourcePackageNames) |
1649 | @@ -417,7 +417,7 @@ class PackagesetSet: | |||
1650 | 417 | 417 | ||
1651 | 418 | def _nameToSourcePackageName(self, source_name): | 418 | def _nameToSourcePackageName(self, source_name): |
1652 | 419 | """Helper to convert a possible string name to ISourcePackageName.""" | 419 | """Helper to convert a possible string name to ISourcePackageName.""" |
1654 | 420 | if isinstance(source_name, six.string_types): | 420 | if isinstance(source_name, str): |
1655 | 421 | source_name = getUtility(ISourcePackageNameSet)[source_name] | 421 | source_name = getUtility(ISourcePackageNameSet)[source_name] |
1656 | 422 | return source_name | 422 | return source_name |
1657 | 423 | 423 | ||
1658 | diff --git a/lib/lp/soyuz/model/processacceptedbugsjob.py b/lib/lp/soyuz/model/processacceptedbugsjob.py | |||
1659 | index cfcb7f1..95c69a8 100644 | |||
1660 | --- a/lib/lp/soyuz/model/processacceptedbugsjob.py | |||
1661 | +++ b/lib/lp/soyuz/model/processacceptedbugsjob.py | |||
1662 | @@ -238,7 +238,7 @@ class ProcessAcceptedBugsJob(StormBase, BaseRunnableJob): | |||
1663 | 238 | self.distroseries = distroseries | 238 | self.distroseries = distroseries |
1664 | 239 | self.sourcepackagerelease = sourcepackagerelease | 239 | self.sourcepackagerelease = sourcepackagerelease |
1665 | 240 | self.metadata = {"bug_ids": list(bug_ids)} | 240 | self.metadata = {"bug_ids": list(bug_ids)} |
1667 | 241 | super(ProcessAcceptedBugsJob, self).__init__() | 241 | super().__init__() |
1668 | 242 | 242 | ||
1669 | 243 | @property | 243 | @property |
1670 | 244 | def bug_ids(self): | 244 | def bug_ids(self): |
1671 | diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py | |||
1672 | index 6141c93..421e649 100644 | |||
1673 | --- a/lib/lp/soyuz/model/publishing.py | |||
1674 | +++ b/lib/lp/soyuz/model/publishing.py | |||
1675 | @@ -20,7 +20,6 @@ import os | |||
1676 | 20 | import sys | 20 | import sys |
1677 | 21 | 21 | ||
1678 | 22 | import pytz | 22 | import pytz |
1679 | 23 | import six | ||
1680 | 24 | from storm.expr import ( | 23 | from storm.expr import ( |
1681 | 25 | And, | 24 | And, |
1682 | 26 | Cast, | 25 | Cast, |
1683 | @@ -485,11 +484,11 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
1684 | 485 | # Check there is a change to make | 484 | # Check there is a change to make |
1685 | 486 | if new_component is None: | 485 | if new_component is None: |
1686 | 487 | new_component = self.component | 486 | new_component = self.component |
1688 | 488 | elif isinstance(new_component, six.string_types): | 487 | elif isinstance(new_component, str): |
1689 | 489 | new_component = getUtility(IComponentSet)[new_component] | 488 | new_component = getUtility(IComponentSet)[new_component] |
1690 | 490 | if new_section is None: | 489 | if new_section is None: |
1691 | 491 | new_section = self.section | 490 | new_section = self.section |
1693 | 492 | elif isinstance(new_section, six.string_types): | 491 | elif isinstance(new_section, str): |
1694 | 493 | new_section = getUtility(ISectionSet)[new_section] | 492 | new_section = getUtility(ISectionSet)[new_section] |
1695 | 494 | 493 | ||
1696 | 495 | if new_component == self.component and new_section == self.section: | 494 | if new_component == self.component and new_section == self.section: |
1697 | @@ -754,7 +753,7 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
1698 | 754 | if self.is_debug and not self.archive.publish_debug_symbols: | 753 | if self.is_debug and not self.archive.publish_debug_symbols: |
1699 | 755 | self.setPublished() | 754 | self.setPublished() |
1700 | 756 | else: | 755 | else: |
1702 | 757 | super(BinaryPackagePublishingHistory, self).publish(diskpool, log) | 756 | super().publish(diskpool, log) |
1703 | 758 | 757 | ||
1704 | 759 | def getOtherPublications(self): | 758 | def getOtherPublications(self): |
1705 | 760 | """See `IBinaryPackagePublishingHistory`.""" | 759 | """See `IBinaryPackagePublishingHistory`.""" |
1706 | @@ -843,15 +842,15 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
1707 | 843 | # Check there is a change to make | 842 | # Check there is a change to make |
1708 | 844 | if new_component is None: | 843 | if new_component is None: |
1709 | 845 | new_component = self.component | 844 | new_component = self.component |
1711 | 846 | elif isinstance(new_component, six.string_types): | 845 | elif isinstance(new_component, str): |
1712 | 847 | new_component = getUtility(IComponentSet)[new_component] | 846 | new_component = getUtility(IComponentSet)[new_component] |
1713 | 848 | if new_section is None: | 847 | if new_section is None: |
1714 | 849 | new_section = self.section | 848 | new_section = self.section |
1716 | 850 | elif isinstance(new_section, six.string_types): | 849 | elif isinstance(new_section, str): |
1717 | 851 | new_section = getUtility(ISectionSet)[new_section] | 850 | new_section = getUtility(ISectionSet)[new_section] |
1718 | 852 | if new_priority is None: | 851 | if new_priority is None: |
1719 | 853 | new_priority = self.priority | 852 | new_priority = self.priority |
1721 | 854 | elif isinstance(new_priority, six.string_types): | 853 | elif isinstance(new_priority, str): |
1722 | 855 | new_priority = name_priority_map[new_priority] | 854 | new_priority = name_priority_map[new_priority] |
1723 | 856 | if new_phased_update_percentage is None: | 855 | if new_phased_update_percentage is None: |
1724 | 857 | new_phased_update_percentage = self.phased_update_percentage | 856 | new_phased_update_percentage = self.phased_update_percentage |
1725 | @@ -1031,7 +1030,7 @@ def expand_binary_requests(distroseries, binaries): | |||
1726 | 1031 | arch_map = {arch.architecturetag: arch for arch in archs} | 1030 | arch_map = {arch.architecturetag: arch for arch in archs} |
1727 | 1032 | 1031 | ||
1728 | 1033 | expanded = [] | 1032 | expanded = [] |
1730 | 1034 | for bpr, overrides in six.iteritems(binaries): | 1033 | for bpr, overrides in binaries.items(): |
1731 | 1035 | if bpr.architecturespecific: | 1034 | if bpr.architecturespecific: |
1732 | 1036 | # Find the DAS in this series corresponding to the original | 1035 | # Find the DAS in this series corresponding to the original |
1733 | 1037 | # build arch tag. If it does not exist or is disabled, we should | 1036 | # build arch tag. If it does not exist or is disabled, we should |
1734 | diff --git a/lib/lp/soyuz/model/queue.py b/lib/lp/soyuz/model/queue.py | |||
1735 | index babe57a..712dd7a 100644 | |||
1736 | --- a/lib/lp/soyuz/model/queue.py | |||
1737 | +++ b/lib/lp/soyuz/model/queue.py | |||
1738 | @@ -16,7 +16,6 @@ from itertools import chain | |||
1739 | 16 | from operator import attrgetter | 16 | from operator import attrgetter |
1740 | 17 | 17 | ||
1741 | 18 | import pytz | 18 | import pytz |
1742 | 19 | import six | ||
1743 | 20 | from storm.expr import Cast | 19 | from storm.expr import Cast |
1744 | 21 | from storm.locals import ( | 20 | from storm.locals import ( |
1745 | 22 | And, | 21 | And, |
1746 | @@ -206,7 +205,7 @@ class PackageUpload(SQLBase): | |||
1747 | 206 | joinColumn='packageupload') | 205 | joinColumn='packageupload') |
1748 | 207 | 206 | ||
1749 | 208 | def __init__(self, *args, **kwargs): | 207 | def __init__(self, *args, **kwargs): |
1751 | 209 | super(PackageUpload, self).__init__(*args, **kwargs) | 208 | super().__init__(*args, **kwargs) |
1752 | 210 | # searchable_{name,version}s are set for the other cases when | 209 | # searchable_{name,version}s are set for the other cases when |
1753 | 211 | # add{Source,Build,Custom} are called. | 210 | # add{Source,Build,Custom} are called. |
1754 | 212 | if self.package_copy_job: | 211 | if self.package_copy_job: |
1755 | @@ -973,7 +972,7 @@ class PackageUpload(SQLBase): | |||
1756 | 973 | def _nameToComponent(self, component): | 972 | def _nameToComponent(self, component): |
1757 | 974 | """Helper to convert a possible string component to IComponent.""" | 973 | """Helper to convert a possible string component to IComponent.""" |
1758 | 975 | try: | 974 | try: |
1760 | 976 | if isinstance(component, six.string_types): | 975 | if isinstance(component, str): |
1761 | 977 | component = getUtility(IComponentSet)[component] | 976 | component = getUtility(IComponentSet)[component] |
1762 | 978 | return component | 977 | return component |
1763 | 979 | except NotFoundError: | 978 | except NotFoundError: |
1764 | @@ -982,7 +981,7 @@ class PackageUpload(SQLBase): | |||
1765 | 982 | def _nameToSection(self, section): | 981 | def _nameToSection(self, section): |
1766 | 983 | """Helper to convert a possible string section to ISection.""" | 982 | """Helper to convert a possible string section to ISection.""" |
1767 | 984 | try: | 983 | try: |
1769 | 985 | if isinstance(section, six.string_types): | 984 | if isinstance(section, str): |
1770 | 986 | section = getUtility(ISectionSet)[section] | 985 | section = getUtility(ISectionSet)[section] |
1771 | 987 | return section | 986 | return section |
1772 | 988 | except NotFoundError: | 987 | except NotFoundError: |
1773 | @@ -991,7 +990,7 @@ class PackageUpload(SQLBase): | |||
1774 | 991 | def _nameToPriority(self, priority): | 990 | def _nameToPriority(self, priority): |
1775 | 992 | """Helper to convert a possible string priority to its enum.""" | 991 | """Helper to convert a possible string priority to its enum.""" |
1776 | 993 | try: | 992 | try: |
1778 | 994 | if isinstance(priority, six.string_types): | 993 | if isinstance(priority, str): |
1779 | 995 | priority = name_priority_map[priority] | 994 | priority = name_priority_map[priority] |
1780 | 996 | return priority | 995 | return priority |
1781 | 997 | except KeyError: | 996 | except KeyError: |
1782 | diff --git a/lib/lp/soyuz/model/sourcepackagerelease.py b/lib/lp/soyuz/model/sourcepackagerelease.py | |||
1783 | index 8b07ecc..64086c3 100644 | |||
1784 | --- a/lib/lp/soyuz/model/sourcepackagerelease.py | |||
1785 | +++ b/lib/lp/soyuz/model/sourcepackagerelease.py | |||
1786 | @@ -145,7 +145,7 @@ class SourcePackageRelease(SQLBase): | |||
1787 | 145 | # loaded every time. Set it separately. | 145 | # loaded every time. Set it separately. |
1788 | 146 | if 'copyright' in kwargs: | 146 | if 'copyright' in kwargs: |
1789 | 147 | copyright = kwargs.pop('copyright') | 147 | copyright = kwargs.pop('copyright') |
1791 | 148 | super(SourcePackageRelease, self).__init__(*args, **kwargs) | 148 | super().__init__(*args, **kwargs) |
1792 | 149 | # PostgresSQL text columns can't contain null | 149 | # PostgresSQL text columns can't contain null |
1793 | 150 | # characters, so remove them as this is only | 150 | # characters, so remove them as this is only |
1794 | 151 | # used for display | 151 | # used for display |
1795 | diff --git a/lib/lp/soyuz/scripts/custom_uploads_copier.py b/lib/lp/soyuz/scripts/custom_uploads_copier.py | |||
1796 | index 55cd1c7..43a0128 100644 | |||
1797 | --- a/lib/lp/soyuz/scripts/custom_uploads_copier.py | |||
1798 | +++ b/lib/lp/soyuz/scripts/custom_uploads_copier.py | |||
1799 | @@ -13,8 +13,6 @@ __all__ = [ | |||
1800 | 13 | 13 | ||
1801 | 14 | from operator import attrgetter | 14 | from operator import attrgetter |
1802 | 15 | 15 | ||
1803 | 16 | import six | ||
1804 | 17 | |||
1805 | 18 | from lp.archivepublisher.ddtp_tarball import DdtpTarballUpload | 16 | from lp.archivepublisher.ddtp_tarball import DdtpTarballUpload |
1806 | 19 | from lp.archivepublisher.debian_installer import DebianInstallerUpload | 17 | from lp.archivepublisher.debian_installer import DebianInstallerUpload |
1807 | 20 | from lp.archivepublisher.dist_upgrader import DistUpgraderUpload | 18 | from lp.archivepublisher.dist_upgrader import DistUpgraderUpload |
1808 | @@ -164,7 +162,7 @@ class CustomUploadsCopier: | |||
1809 | 164 | self.target_series, source_pocket=self.target_pocket) | 162 | self.target_series, source_pocket=self.target_pocket) |
1810 | 165 | source_uploads = self.getLatestUploads( | 163 | source_uploads = self.getLatestUploads( |
1811 | 166 | source_series, source_pocket=source_pocket) | 164 | source_series, source_pocket=source_pocket) |
1813 | 167 | for upload in six.itervalues(source_uploads): | 165 | for upload in source_uploads.values(): |
1814 | 168 | if (not self.isObsolete(upload, target_uploads) and | 166 | if (not self.isObsolete(upload, target_uploads) and |
1815 | 169 | self.isForValidDAS(upload)): | 167 | self.isForValidDAS(upload)): |
1816 | 170 | self.copyUpload(upload) | 168 | self.copyUpload(upload) |
1817 | diff --git a/lib/lp/soyuz/scripts/ftpmasterbase.py b/lib/lp/soyuz/scripts/ftpmasterbase.py | |||
1818 | index 0b3aa2e..7a1fe88 100644 | |||
1819 | --- a/lib/lp/soyuz/scripts/ftpmasterbase.py | |||
1820 | +++ b/lib/lp/soyuz/scripts/ftpmasterbase.py | |||
1821 | @@ -11,8 +11,6 @@ __all__ = [ | |||
1822 | 11 | 'SoyuzScript', | 11 | 'SoyuzScript', |
1823 | 12 | ] | 12 | ] |
1824 | 13 | 13 | ||
1825 | 14 | from six.moves import input | ||
1826 | 15 | |||
1827 | 16 | from lp.services.scripts.base import ( | 14 | from lp.services.scripts.base import ( |
1828 | 17 | LaunchpadScript, | 15 | LaunchpadScript, |
1829 | 18 | LaunchpadScriptFailure, | 16 | LaunchpadScriptFailure, |
1830 | diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py | |||
1831 | index b527ab7..483af39 100644 | |||
1832 | --- a/lib/lp/soyuz/scripts/gina/handlers.py | |||
1833 | +++ b/lib/lp/soyuz/scripts/gina/handlers.py | |||
1834 | @@ -22,7 +22,6 @@ import io | |||
1835 | 22 | import os | 22 | import os |
1836 | 23 | import re | 23 | import re |
1837 | 24 | 24 | ||
1838 | 25 | import six | ||
1839 | 26 | from storm.exceptions import NotOneError | 25 | from storm.exceptions import NotOneError |
1840 | 27 | from storm.expr import ( | 26 | from storm.expr import ( |
1841 | 28 | Cast, | 27 | Cast, |
1842 | @@ -504,8 +503,7 @@ class SourcePackageHandler: | |||
1843 | 504 | sp_version, sp_component)) | 503 | sp_version, sp_component)) |
1844 | 505 | dsc_contents = parse_tagfile(dsc_path) | 504 | dsc_contents = parse_tagfile(dsc_path) |
1845 | 506 | dsc_contents = { | 505 | dsc_contents = { |
1848 | 507 | name.lower(): value for | 506 | name.lower(): value for (name, value) in dsc_contents.items()} |
1847 | 508 | (name, value) in six.iteritems(dsc_contents)} | ||
1849 | 509 | 507 | ||
1850 | 510 | # Since the dsc doesn't know, we add in the directory, package | 508 | # Since the dsc doesn't know, we add in the directory, package |
1851 | 511 | # component and section | 509 | # component and section |
1852 | diff --git a/lib/lp/soyuz/scripts/gina/runner.py b/lib/lp/soyuz/scripts/gina/runner.py | |||
1853 | index df60215..fbdecf5 100644 | |||
1854 | --- a/lib/lp/soyuz/scripts/gina/runner.py | |||
1855 | +++ b/lib/lp/soyuz/scripts/gina/runner.py | |||
1856 | @@ -165,7 +165,7 @@ def import_sourcepackages(distro, packages_map, package_root, | |||
1857 | 165 | 165 | ||
1858 | 166 | def do_one_sourcepackage(distro, source, package_root, importer_handler): | 166 | def do_one_sourcepackage(distro, source, package_root, importer_handler): |
1859 | 167 | source_data = SourcePackageData(**source) | 167 | source_data = SourcePackageData(**source) |
1861 | 168 | skip_key = u'%s/%s/%s' % (distro, source_data.package, source_data.version) | 168 | skip_key = '%s/%s/%s' % (distro, source_data.package, source_data.version) |
1862 | 169 | skip_list = getFeatureFlag('soyuz.gina.skip_source_versions') | 169 | skip_list = getFeatureFlag('soyuz.gina.skip_source_versions') |
1863 | 170 | if skip_list is not None and skip_key in skip_list.split(): | 170 | if skip_list is not None and skip_key in skip_list.split(): |
1864 | 171 | log.info( | 171 | log.info( |
1865 | diff --git a/lib/lp/soyuz/scripts/packagecopier.py b/lib/lp/soyuz/scripts/packagecopier.py | |||
1866 | index c1fb6cb..d5388d3 100644 | |||
1867 | --- a/lib/lp/soyuz/scripts/packagecopier.py | |||
1868 | +++ b/lib/lp/soyuz/scripts/packagecopier.py | |||
1869 | @@ -259,8 +259,7 @@ class CopyChecker: | |||
1870 | 259 | def getCheckedCopies(self): | 259 | def getCheckedCopies(self): |
1871 | 260 | """Return a list of copies allowed to be performed.""" | 260 | """Return a list of copies allowed to be performed.""" |
1872 | 261 | for copies in self._inventory.values(): | 261 | for copies in self._inventory.values(): |
1875 | 262 | for copy in copies: | 262 | yield from copies |
1874 | 263 | yield copy | ||
1876 | 264 | 263 | ||
1877 | 265 | def getConflicts(self, candidate): | 264 | def getConflicts(self, candidate): |
1878 | 266 | """Conflicting `CheckedCopy` objects in the inventory. | 265 | """Conflicting `CheckedCopy` objects in the inventory. |
1879 | diff --git a/lib/lp/soyuz/scripts/populate_archive.py b/lib/lp/soyuz/scripts/populate_archive.py | |||
1880 | index 0eb4f68..1b9b12b 100644 | |||
1881 | --- a/lib/lp/soyuz/scripts/populate_archive.py | |||
1882 | +++ b/lib/lp/soyuz/scripts/populate_archive.py | |||
1883 | @@ -36,7 +36,7 @@ def specified(option): | |||
1884 | 36 | """ | 36 | """ |
1885 | 37 | if option is None: | 37 | if option is None: |
1886 | 38 | return False | 38 | return False |
1888 | 39 | if isinstance(option, six.string_types) and option.strip() == '': | 39 | if isinstance(option, str) and option.strip() == '': |
1889 | 40 | return False | 40 | return False |
1890 | 41 | return True | 41 | return True |
1891 | 42 | 42 | ||
1892 | diff --git a/lib/lp/soyuz/scripts/ppareport.py b/lib/lp/soyuz/scripts/ppareport.py | |||
1893 | index 94914fe..c9e106c 100644 | |||
1894 | --- a/lib/lp/soyuz/scripts/ppareport.py | |||
1895 | +++ b/lib/lp/soyuz/scripts/ppareport.py | |||
1896 | @@ -186,7 +186,7 @@ class PPAReportScript(LaunchpadScript): | |||
1897 | 186 | sorted_people_to_email = sorted( | 186 | sorted_people_to_email = sorted( |
1898 | 187 | people_to_email, key=operator.attrgetter('name')) | 187 | people_to_email, key=operator.attrgetter('name')) |
1899 | 188 | for user in sorted_people_to_email: | 188 | for user in sorted_people_to_email: |
1901 | 189 | line = u"%s | %s | %s\n" % ( | 189 | line = "%s | %s | %s\n" % ( |
1902 | 190 | user.name, user.displayname, user.preferredemail.email) | 190 | user.name, user.displayname, user.preferredemail.email) |
1903 | 191 | self.output.write(six.ensure_str(line)) | 191 | self.output.write(six.ensure_str(line)) |
1904 | 192 | self.output.write('\n') | 192 | self.output.write('\n') |
1905 | diff --git a/lib/lp/soyuz/scripts/retrydepwait.py b/lib/lp/soyuz/scripts/retrydepwait.py | |||
1906 | index a6a41af..9f86c24 100644 | |||
1907 | --- a/lib/lp/soyuz/scripts/retrydepwait.py | |||
1908 | +++ b/lib/lp/soyuz/scripts/retrydepwait.py | |||
1909 | @@ -33,7 +33,7 @@ class RetryDepwaitTunableLoop(TunableLoop): | |||
1910 | 33 | maximum_chunk_size = 5000 | 33 | maximum_chunk_size = 5000 |
1911 | 34 | 34 | ||
1912 | 35 | def __init__(self, log, dry_run, abort_time=None): | 35 | def __init__(self, log, dry_run, abort_time=None): |
1914 | 36 | super(RetryDepwaitTunableLoop, self).__init__(log, abort_time) | 36 | super().__init__(log, abort_time) |
1915 | 37 | self.dry_run = dry_run | 37 | self.dry_run = dry_run |
1916 | 38 | self.start_at = 1 | 38 | self.start_at = 1 |
1917 | 39 | self.store = IStore(BinaryPackageBuild) | 39 | self.store = IStore(BinaryPackageBuild) |
1918 | diff --git a/lib/lp/soyuz/scripts/tests/test_copypackage.py b/lib/lp/soyuz/scripts/tests/test_copypackage.py | |||
1919 | index 62ced33..223f697 100644 | |||
1920 | --- a/lib/lp/soyuz/scripts/tests/test_copypackage.py | |||
1921 | +++ b/lib/lp/soyuz/scripts/tests/test_copypackage.py | |||
1922 | @@ -440,7 +440,7 @@ class CopyCheckerQueries(TestCaseWithFactory, | |||
1923 | 440 | layer = LaunchpadZopelessLayer | 440 | layer = LaunchpadZopelessLayer |
1924 | 441 | 441 | ||
1925 | 442 | def setUp(self): | 442 | def setUp(self): |
1927 | 443 | super(CopyCheckerQueries, self).setUp() | 443 | super().setUp() |
1928 | 444 | self.test_publisher = SoyuzTestPublisher() | 444 | self.test_publisher = SoyuzTestPublisher() |
1929 | 445 | self.test_publisher.prepareBreezyAutotest() | 445 | self.test_publisher.prepareBreezyAutotest() |
1930 | 446 | self.source = self.test_publisher.getPubSource() | 446 | self.source = self.test_publisher.getPubSource() |
1931 | @@ -458,8 +458,8 @@ class CopyCheckerQueries(TestCaseWithFactory, | |||
1932 | 458 | sources = [] | 458 | sources = [] |
1933 | 459 | for i in range(nb_of_sources): | 459 | for i in range(nb_of_sources): |
1934 | 460 | source = self.test_publisher.getPubSource( | 460 | source = self.test_publisher.getPubSource( |
1937 | 461 | version=u'%d' % self.factory.getUniqueInteger(), | 461 | version='%d' % self.factory.getUniqueInteger(), |
1938 | 462 | sourcename=u'name-%d' % self.factory.getUniqueInteger()) | 462 | sourcename='name-%d' % self.factory.getUniqueInteger()) |
1939 | 463 | sources.append(source) | 463 | sources.append(source) |
1940 | 464 | return sources | 464 | return sources |
1941 | 465 | 465 | ||
1942 | @@ -486,7 +486,7 @@ class CopyCheckerQueries(TestCaseWithFactory, | |||
1943 | 486 | recorder0 = self._recordCopyCheck(0, self.person, True) | 486 | recorder0 = self._recordCopyCheck(0, self.person, True) |
1944 | 487 | self.addDetail( | 487 | self.addDetail( |
1945 | 488 | "statement-count-0-sources", | 488 | "statement-count-0-sources", |
1947 | 489 | text_content(u"%d" % recorder0.count)) | 489 | text_content("%d" % recorder0.count)) |
1948 | 490 | self.assertThat(recorder0, HasQueryCount(Equals(0))) | 490 | self.assertThat(recorder0, HasQueryCount(Equals(0))) |
1949 | 491 | 491 | ||
1950 | 492 | # Compare the number of queries issued by calling checkCopy with | 492 | # Compare the number of queries issued by calling checkCopy with |
1951 | @@ -495,12 +495,12 @@ class CopyCheckerQueries(TestCaseWithFactory, | |||
1952 | 495 | recorder1 = self._recordCopyCheck(nb_of_sources, self.person, True) | 495 | recorder1 = self._recordCopyCheck(nb_of_sources, self.person, True) |
1953 | 496 | self.addDetail( | 496 | self.addDetail( |
1954 | 497 | "statement-count-%d-sources" % nb_of_sources, | 497 | "statement-count-%d-sources" % nb_of_sources, |
1956 | 498 | text_content(u"%d" % recorder1.count)) | 498 | text_content("%d" % recorder1.count)) |
1957 | 499 | recorder2 = self._recordCopyCheck( | 499 | recorder2 = self._recordCopyCheck( |
1958 | 500 | nb_of_sources + 1, self.person, True) | 500 | nb_of_sources + 1, self.person, True) |
1959 | 501 | self.addDetail( | 501 | self.addDetail( |
1960 | 502 | "statement-count-%d-sources" % (nb_of_sources + 1), | 502 | "statement-count-%d-sources" % (nb_of_sources + 1), |
1962 | 503 | text_content(u"%d" % recorder2.count)) | 503 | text_content("%d" % recorder2.count)) |
1963 | 504 | 504 | ||
1964 | 505 | statement_count_per_source = 13 | 505 | statement_count_per_source = 13 |
1965 | 506 | self.assertThat( | 506 | self.assertThat( |
1966 | @@ -518,7 +518,7 @@ class CopyCheckerQueries(TestCaseWithFactory, | |||
1967 | 518 | (recorder2.count - recorder1.count) / float(nb_of_sources)) | 518 | (recorder2.count - recorder1.count) / float(nb_of_sources)) |
1968 | 519 | self.addDetail( | 519 | self.addDetail( |
1969 | 520 | "added-statement-count-perm-check", | 520 | "added-statement-count-perm-check", |
1971 | 521 | text_content(u"%.3f" % added_statement_count_per_source)) | 521 | text_content("%.3f" % added_statement_count_per_source)) |
1972 | 522 | 522 | ||
1973 | 523 | perm_check_statement_count = 3 | 523 | perm_check_statement_count = 3 |
1974 | 524 | self.assertThat( | 524 | self.assertThat( |
1975 | @@ -531,7 +531,7 @@ class CopyCheckerSameArchiveHarness(TestCaseWithFactory, | |||
1976 | 531 | layer = LaunchpadZopelessLayer | 531 | layer = LaunchpadZopelessLayer |
1977 | 532 | 532 | ||
1978 | 533 | def setUp(self): | 533 | def setUp(self): |
1980 | 534 | super(CopyCheckerSameArchiveHarness, self).setUp() | 534 | super().setUp() |
1981 | 535 | self.test_publisher = SoyuzTestPublisher() | 535 | self.test_publisher = SoyuzTestPublisher() |
1982 | 536 | self.test_publisher.prepareBreezyAutotest() | 536 | self.test_publisher.prepareBreezyAutotest() |
1983 | 537 | self.source = self.test_publisher.getPubSource() | 537 | self.source = self.test_publisher.getPubSource() |
1984 | @@ -609,7 +609,7 @@ class CopyCheckerDifferentArchiveHarness(TestCaseWithFactory, | |||
1985 | 609 | layer = LaunchpadZopelessLayer | 609 | layer = LaunchpadZopelessLayer |
1986 | 610 | 610 | ||
1987 | 611 | def setUp(self): | 611 | def setUp(self): |
1989 | 612 | super(CopyCheckerDifferentArchiveHarness, self).setUp() | 612 | super().setUp() |
1990 | 613 | self.test_publisher = SoyuzTestPublisher() | 613 | self.test_publisher = SoyuzTestPublisher() |
1991 | 614 | self.test_publisher.prepareBreezyAutotest() | 614 | self.test_publisher.prepareBreezyAutotest() |
1992 | 615 | self.source = self.test_publisher.getPubSource() | 615 | self.source = self.test_publisher.getPubSource() |
1993 | @@ -825,7 +825,7 @@ class CopyCheckerTestCase(TestCaseWithFactory): | |||
1994 | 825 | layer = LaunchpadZopelessLayer | 825 | layer = LaunchpadZopelessLayer |
1995 | 826 | 826 | ||
1996 | 827 | def setUp(self): | 827 | def setUp(self): |
1998 | 828 | super(CopyCheckerTestCase, self).setUp() | 828 | super().setUp() |
1999 | 829 | self.test_publisher = SoyuzTestPublisher() | 829 | self.test_publisher = SoyuzTestPublisher() |
2000 | 830 | self.test_publisher.prepareBreezyAutotest() | 830 | self.test_publisher.prepareBreezyAutotest() |
2001 | 831 | 831 | ||
2002 | @@ -1051,7 +1051,7 @@ class BaseDoCopyTests: | |||
2003 | 1051 | layer = LaunchpadZopelessLayer | 1051 | layer = LaunchpadZopelessLayer |
2004 | 1052 | 1052 | ||
2005 | 1053 | def setUp(self): | 1053 | def setUp(self): |
2007 | 1054 | super(BaseDoCopyTests, self).setUp() | 1054 | super().setUp() |
2008 | 1055 | for arch in ('i386', 'hppa'): | 1055 | for arch in ('i386', 'hppa'): |
2009 | 1056 | self.factory.makeProcessor(name='my_%s' % arch) | 1056 | self.factory.makeProcessor(name='my_%s' % arch) |
2010 | 1057 | 1057 | ||
2011 | @@ -1130,14 +1130,14 @@ class BaseDoCopyTests: | |||
2012 | 1130 | class TestDoDirectCopy(BaseDoCopyTests, TestCaseWithFactory): | 1130 | class TestDoDirectCopy(BaseDoCopyTests, TestCaseWithFactory): |
2013 | 1131 | 1131 | ||
2014 | 1132 | def setUp(self): | 1132 | def setUp(self): |
2016 | 1133 | super(TestDoDirectCopy, self).setUp() | 1133 | super().setUp() |
2017 | 1134 | self.test_publisher = SoyuzTestPublisher() | 1134 | self.test_publisher = SoyuzTestPublisher() |
2018 | 1135 | self.test_publisher.prepareBreezyAutotest() | 1135 | self.test_publisher.prepareBreezyAutotest() |
2019 | 1136 | 1136 | ||
2020 | 1137 | def assertCopied(self, copies, series, arch_tags): | 1137 | def assertCopied(self, copies, series, arch_tags): |
2021 | 1138 | self.assertEqual( | 1138 | self.assertEqual( |
2024 | 1139 | [u'foo 666 in %s' % series.name] + | 1139 | ['foo 666 in %s' % series.name] + |
2025 | 1140 | [u'foo-bin 666 in %s %s' % (series.name, arch_tag) | 1140 | ['foo-bin 666 in %s %s' % (series.name, arch_tag) |
2026 | 1141 | for arch_tag in arch_tags], | 1141 | for arch_tag in arch_tags], |
2027 | 1142 | [copy.displayname for copy in copies]) | 1142 | [copy.displayname for copy in copies]) |
2028 | 1143 | 1143 | ||
2029 | @@ -1782,7 +1782,7 @@ class TestCopyBuildRecords(TestCaseWithFactory): | |||
2030 | 1782 | layer = LaunchpadZopelessLayer | 1782 | layer = LaunchpadZopelessLayer |
2031 | 1783 | 1783 | ||
2032 | 1784 | def setUp(self): | 1784 | def setUp(self): |
2034 | 1785 | super(TestCopyBuildRecords, self).setUp() | 1785 | super().setUp() |
2035 | 1786 | self.test_publisher = SoyuzTestPublisher() | 1786 | self.test_publisher = SoyuzTestPublisher() |
2036 | 1787 | self.test_publisher.prepareBreezyAutotest() | 1787 | self.test_publisher.prepareBreezyAutotest() |
2037 | 1788 | self.primary = self.test_publisher.ubuntutest.main_archive | 1788 | self.primary = self.test_publisher.ubuntutest.main_archive |
2038 | @@ -2047,7 +2047,7 @@ class TestCopyClosesBugs(TestCaseWithFactory): | |||
2039 | 2047 | layer = LaunchpadZopelessLayer | 2047 | layer = LaunchpadZopelessLayer |
2040 | 2048 | 2048 | ||
2041 | 2049 | def setUp(self): | 2049 | def setUp(self): |
2043 | 2050 | super(TestCopyClosesBugs, self).setUp() | 2050 | super().setUp() |
2044 | 2051 | self.test_publisher = SoyuzTestPublisher() | 2051 | self.test_publisher = SoyuzTestPublisher() |
2045 | 2052 | self.test_publisher.prepareBreezyAutotest() | 2052 | self.test_publisher.prepareBreezyAutotest() |
2046 | 2053 | self.ubuntutest = self.test_publisher.ubuntutest | 2053 | self.ubuntutest = self.test_publisher.ubuntutest |
2047 | diff --git a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py | |||
2048 | index fefef02..a5d381d 100644 | |||
2049 | --- a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py | |||
2050 | +++ b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py | |||
2051 | @@ -28,7 +28,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory): | |||
2052 | 28 | 28 | ||
2053 | 29 | def setUp(self): | 29 | def setUp(self): |
2054 | 30 | """Set up some test publications.""" | 30 | """Set up some test publications.""" |
2056 | 31 | super(ArchiveExpiryTestBase, self).setUp() | 31 | super().setUp() |
2057 | 32 | # Configure the test publisher. | 32 | # Configure the test publisher. |
2058 | 33 | switch_dbuser("launchpad") | 33 | switch_dbuser("launchpad") |
2059 | 34 | self.stp = SoyuzTestPublisher() | 34 | self.stp = SoyuzTestPublisher() |
2060 | @@ -100,7 +100,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory): | |||
2061 | 100 | "lfa.expires should be None, but it's not.") | 100 | "lfa.expires should be None, but it's not.") |
2062 | 101 | 101 | ||
2063 | 102 | 102 | ||
2065 | 103 | class ArchiveExpiryCommonTests(object): | 103 | class ArchiveExpiryCommonTests: |
2066 | 104 | """Common source/binary expiration test cases. | 104 | """Common source/binary expiration test cases. |
2067 | 105 | 105 | ||
2068 | 106 | These will be shared irrespective of archive type (ppa/partner). | 106 | These will be shared irrespective of archive type (ppa/partner). |
2069 | @@ -233,7 +233,7 @@ class TestPPAExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests): | |||
2070 | 233 | 233 | ||
2071 | 234 | def setUp(self): | 234 | def setUp(self): |
2072 | 235 | """Set up some test publications.""" | 235 | """Set up some test publications.""" |
2074 | 236 | super(TestPPAExpiry, self).setUp() | 236 | super().setUp() |
2075 | 237 | # Prepare two PPAs for the tests to use. | 237 | # Prepare two PPAs for the tests to use. |
2076 | 238 | self.archive = self.factory.makeArchive( | 238 | self.archive = self.factory.makeArchive( |
2077 | 239 | distribution=getUtility(IDistributionSet)['ubuntutest']) | 239 | distribution=getUtility(IDistributionSet)['ubuntutest']) |
2078 | @@ -287,7 +287,7 @@ class TestPartnerExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests): | |||
2079 | 287 | 287 | ||
2080 | 288 | def setUp(self): | 288 | def setUp(self): |
2081 | 289 | """Set up the partner archives under test.""" | 289 | """Set up the partner archives under test.""" |
2083 | 290 | super(TestPartnerExpiry, self).setUp() | 290 | super().setUp() |
2084 | 291 | # Prepare two partner archives for the tests to use. | 291 | # Prepare two partner archives for the tests to use. |
2085 | 292 | self.archive = getUtility(IDistributionSet)[ | 292 | self.archive = getUtility(IDistributionSet)[ |
2086 | 293 | 'ubuntutest'].getArchiveByComponent('partner') | 293 | 'ubuntutest'].getArchiveByComponent('partner') |
2087 | diff --git a/lib/lp/soyuz/scripts/tests/test_gina.py b/lib/lp/soyuz/scripts/tests/test_gina.py | |||
2088 | index 69720b1..f8174f3 100644 | |||
2089 | --- a/lib/lp/soyuz/scripts/tests/test_gina.py | |||
2090 | +++ b/lib/lp/soyuz/scripts/tests/test_gina.py | |||
2091 | @@ -248,7 +248,7 @@ class TestSourcePackageData(TestCaseWithFactory): | |||
2092 | 248 | # called in such a way as to cope with non-UTF-8 file names on | 248 | # called in such a way as to cope with non-UTF-8 file names on |
2093 | 249 | # Python 2. See | 249 | # Python 2. See |
2094 | 250 | # https://bugs.launchpad.net/launchpad/+bug/1917449. | 250 | # https://bugs.launchpad.net/launchpad/+bug/1917449. |
2096 | 251 | orig_tar.add_file(u"Ćslenska.alias", b"Non-UTF-8 file name") | 251 | orig_tar.add_file("Ćslenska.alias", b"Non-UTF-8 file name") |
2097 | 252 | orig_tar.close() | 252 | orig_tar.close() |
2098 | 253 | buffer.seek(0) | 253 | buffer.seek(0) |
2099 | 254 | orig_tar_contents = buffer.read() | 254 | orig_tar_contents = buffer.read() |
2100 | @@ -309,7 +309,7 @@ class TestSourcePackageData(TestCaseWithFactory): | |||
2101 | 309 | # called in such a way as to cope with non-UTF-8 file names on | 309 | # called in such a way as to cope with non-UTF-8 file names on |
2102 | 310 | # Python 2. See | 310 | # Python 2. See |
2103 | 311 | # https://bugs.launchpad.net/launchpad/+bug/1917449. | 311 | # https://bugs.launchpad.net/launchpad/+bug/1917449. |
2105 | 312 | orig_tar.add_file(u"Ćslenska.alias", b"Non-UTF-8 file name") | 312 | orig_tar.add_file("Ćslenska.alias", b"Non-UTF-8 file name") |
2106 | 313 | orig_tar.close() | 313 | orig_tar.close() |
2107 | 314 | buffer.seek(0) | 314 | buffer.seek(0) |
2108 | 315 | orig_tar_contents = buffer.read() | 315 | orig_tar_contents = buffer.read() |
2109 | diff --git a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py | |||
2110 | index b3edb46..f3fa2cc 100644 | |||
2111 | --- a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py | |||
2112 | +++ b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py | |||
2113 | @@ -194,10 +194,10 @@ class InitializationHelperTestCase(TestCaseWithFactory): | |||
2114 | 194 | # Setup the environment for testing the packaging links | 194 | # Setup the environment for testing the packaging links |
2115 | 195 | self.parent, self.parent_das = self.setupParent() | 195 | self.parent, self.parent_das = self.setupParent() |
2116 | 196 | test1 = getUtility(IPackagesetSet).new( | 196 | test1 = getUtility(IPackagesetSet).new( |
2118 | 197 | u'test1', u'test 1 packageset', self.parent.owner, | 197 | 'test1', 'test 1 packageset', self.parent.owner, |
2119 | 198 | distroseries=self.parent) | 198 | distroseries=self.parent) |
2120 | 199 | test2 = getUtility(IPackagesetSet).new( | 199 | test2 = getUtility(IPackagesetSet).new( |
2122 | 200 | u'test2', u'test 2 packageset', self.parent.owner, | 200 | 'test2', 'test 2 packageset', self.parent.owner, |
2123 | 201 | distroseries=self.parent) | 201 | distroseries=self.parent) |
2124 | 202 | packages_test1 = ['udev', 'chromium', 'libc6'] | 202 | packages_test1 = ['udev', 'chromium', 'libc6'] |
2125 | 203 | packages_test2 = ['postgresql', 'vim'] | 203 | packages_test2 = ['postgresql', 'vim'] |
2126 | @@ -351,9 +351,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2127 | 351 | # packagesets selected for the copy will make the queue check fail. | 351 | # packagesets selected for the copy will make the queue check fail. |
2128 | 352 | parent, parent_das = self.setupParent() | 352 | parent, parent_das = self.setupParent() |
2129 | 353 | p1, packageset1, unsed = self.createPackageInPackageset( | 353 | p1, packageset1, unsed = self.createPackageInPackageset( |
2131 | 354 | parent, u'p1', u'packageset1', True) | 354 | parent, 'p1', 'packageset1', True) |
2132 | 355 | p2, packageset2, unsed = self.createPackageInPackageset( | 355 | p2, packageset2, unsed = self.createPackageInPackageset( |
2134 | 356 | parent, u'p2', u'packageset2', False) | 356 | parent, 'p2', 'packageset2', False) |
2135 | 357 | 357 | ||
2136 | 358 | child = self.factory.makeDistroSeries( | 358 | child = self.factory.makeDistroSeries( |
2137 | 359 | distribution=parent.distribution, previous_series=parent) | 359 | distribution=parent.distribution, previous_series=parent) |
2138 | @@ -371,9 +371,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2139 | 371 | # packagesets selected for the copy won't make the queue check fail. | 371 | # packagesets selected for the copy won't make the queue check fail. |
2140 | 372 | parent, parent_das = self.setupParent() | 372 | parent, parent_das = self.setupParent() |
2141 | 373 | p1, packageset1, unused = self.createPackageInPackageset( | 373 | p1, packageset1, unused = self.createPackageInPackageset( |
2143 | 374 | parent, u'p1', u'packageset1', True) | 374 | parent, 'p1', 'packageset1', True) |
2144 | 375 | p2, packageset2, unused = self.createPackageInPackageset( | 375 | p2, packageset2, unused = self.createPackageInPackageset( |
2146 | 376 | parent, u'p2', u'packageset2', False) | 376 | parent, 'p2', 'packageset2', False) |
2147 | 377 | 377 | ||
2148 | 378 | child = self.factory.makeDistroSeries( | 378 | child = self.factory.makeDistroSeries( |
2149 | 379 | distribution=parent.distribution, previous_series=parent) | 379 | distribution=parent.distribution, previous_series=parent) |
2150 | @@ -596,9 +596,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2151 | 596 | # initialize. | 596 | # initialize. |
2152 | 597 | parent, parent_das = self.setupParent() | 597 | parent, parent_das = self.setupParent() |
2153 | 598 | p1, packageset1, spr1 = self.createPackageInPackageset( | 598 | p1, packageset1, spr1 = self.createPackageInPackageset( |
2155 | 599 | parent, u'p1', u'packageset1', False) | 599 | parent, 'p1', 'packageset1', False) |
2156 | 600 | p2, packageset2, spr2 = self.createPackageInPackageset( | 600 | p2, packageset2, spr2 = self.createPackageInPackageset( |
2158 | 601 | parent, u'p2', u'packageset2', False) | 601 | parent, 'p2', 'packageset2', False) |
2159 | 602 | 602 | ||
2160 | 603 | # Create a binary package upload for the package 'p2' inside | 603 | # Create a binary package upload for the package 'p2' inside |
2161 | 604 | # packageset 'packageset2'. | 604 | # packageset 'packageset2'. |
2162 | @@ -622,7 +622,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2163 | 622 | # initialize. | 622 | # initialize. |
2164 | 623 | parent, parent_das = self.setupParent() | 623 | parent, parent_das = self.setupParent() |
2165 | 624 | p1, packageset1, spr1 = self.createPackageInPackageset( | 624 | p1, packageset1, spr1 = self.createPackageInPackageset( |
2167 | 625 | parent, u'p1', u'packageset1', False) | 625 | parent, 'p1', 'packageset1', False) |
2168 | 626 | 626 | ||
2169 | 627 | # Create a binary package upload for the package 'p2' inside | 627 | # Create a binary package upload for the package 'p2' inside |
2170 | 628 | # packageset 'packageset2'. | 628 | # packageset 'packageset2'. |
2171 | @@ -648,31 +648,31 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2172 | 648 | child_pocket=PackagePublishingPocket.RELEASE): | 648 | child_pocket=PackagePublishingPocket.RELEASE): |
2173 | 649 | # Check that 'udev' has been copied correctly. | 649 | # Check that 'udev' has been copied correctly. |
2174 | 650 | parent_udev_pubs = parent.main_archive.getPublishedSources( | 650 | parent_udev_pubs = parent.main_archive.getPublishedSources( |
2176 | 651 | u'udev', distroseries=parent) | 651 | 'udev', distroseries=parent) |
2177 | 652 | child_udev_pubs = child.main_archive.getPublishedSources( | 652 | child_udev_pubs = child.main_archive.getPublishedSources( |
2179 | 653 | u'udev', distroseries=child) | 653 | 'udev', distroseries=child) |
2180 | 654 | self.assertEqual( | 654 | self.assertEqual( |
2181 | 655 | parent_udev_pubs.count(), child_udev_pubs.count()) | 655 | parent_udev_pubs.count(), child_udev_pubs.count()) |
2182 | 656 | self.assertEqual( | 656 | self.assertEqual( |
2183 | 657 | {child_pocket}, {pub.pocket for pub in child_udev_pubs}) | 657 | {child_pocket}, {pub.pocket for pub in child_udev_pubs}) |
2184 | 658 | parent_arch_udev_pubs = parent.main_archive.getAllPublishedBinaries( | 658 | parent_arch_udev_pubs = parent.main_archive.getAllPublishedBinaries( |
2186 | 659 | distroarchseries=parent[parent_das.architecturetag], name=u'udev') | 659 | distroarchseries=parent[parent_das.architecturetag], name='udev') |
2187 | 660 | child_arch_udev_pubs = child.main_archive.getAllPublishedBinaries( | 660 | child_arch_udev_pubs = child.main_archive.getAllPublishedBinaries( |
2189 | 661 | distroarchseries=child[parent_das.architecturetag], name=u'udev') | 661 | distroarchseries=child[parent_das.architecturetag], name='udev') |
2190 | 662 | self.assertEqual( | 662 | self.assertEqual( |
2191 | 663 | parent_arch_udev_pubs.count(), child_arch_udev_pubs.count()) | 663 | parent_arch_udev_pubs.count(), child_arch_udev_pubs.count()) |
2192 | 664 | self.assertEqual( | 664 | self.assertEqual( |
2193 | 665 | {child_pocket}, {pub.pocket for pub in child_arch_udev_pubs}) | 665 | {child_pocket}, {pub.pocket for pub in child_arch_udev_pubs}) |
2194 | 666 | # And the binary package, and linked source package look fine too. | 666 | # And the binary package, and linked source package look fine too. |
2195 | 667 | udev_bin = child_arch_udev_pubs[0].binarypackagerelease | 667 | udev_bin = child_arch_udev_pubs[0].binarypackagerelease |
2197 | 668 | self.assertEqual(udev_bin.title, u'udev-0.1-1') | 668 | self.assertEqual(udev_bin.title, 'udev-0.1-1') |
2198 | 669 | self.assertEqual( | 669 | self.assertEqual( |
2199 | 670 | udev_bin.build.title, | 670 | udev_bin.build.title, |
2201 | 671 | u'%s build of udev 0.1-1 in %s %s RELEASE' % ( | 671 | '%s build of udev 0.1-1 in %s %s RELEASE' % ( |
2202 | 672 | parent_das.architecturetag, parent.parent.name, | 672 | parent_das.architecturetag, parent.parent.name, |
2203 | 673 | parent.name)) | 673 | parent.name)) |
2204 | 674 | udev_src = udev_bin.build.source_package_release | 674 | udev_src = udev_bin.build.source_package_release |
2206 | 675 | self.assertEqual(udev_src.title, u'udev - 0.1-1') | 675 | self.assertEqual(udev_src.title, 'udev - 0.1-1') |
2207 | 676 | # The build of udev 0.1-1 has been copied across. | 676 | # The build of udev 0.1-1 has been copied across. |
2208 | 677 | bpbs = getUtility(IBinaryPackageBuildSet) | 677 | bpbs = getUtility(IBinaryPackageBuildSet) |
2209 | 678 | child_udev = bpbs.findBuiltOrPublishedBySourceAndArchive( | 678 | child_udev = bpbs.findBuiltOrPublishedBySourceAndArchive( |
2210 | @@ -721,22 +721,22 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2211 | 721 | self.parent, self.parent_das = self.setupParent() | 721 | self.parent, self.parent_das = self.setupParent() |
2212 | 722 | uploader = self.factory.makePerson() | 722 | uploader = self.factory.makePerson() |
2213 | 723 | test1 = getUtility(IPackagesetSet).new( | 723 | test1 = getUtility(IPackagesetSet).new( |
2215 | 724 | u'test1', u'test 1 packageset', self.parent.owner, | 724 | 'test1', 'test 1 packageset', self.parent.owner, |
2216 | 725 | distroseries=self.parent) | 725 | distroseries=self.parent) |
2217 | 726 | test2 = getUtility(IPackagesetSet).new( | 726 | test2 = getUtility(IPackagesetSet).new( |
2219 | 727 | u'test2', u'test 2 packageset', self.parent.owner, | 727 | 'test2', 'test 2 packageset', self.parent.owner, |
2220 | 728 | distroseries=self.parent) | 728 | distroseries=self.parent) |
2221 | 729 | test3 = getUtility(IPackagesetSet).new( | 729 | test3 = getUtility(IPackagesetSet).new( |
2223 | 730 | u'test3', u'test 3 packageset', self.parent.owner, | 730 | 'test3', 'test 3 packageset', self.parent.owner, |
2224 | 731 | distroseries=self.parent, related_set=test2) | 731 | distroseries=self.parent, related_set=test2) |
2225 | 732 | test1.addSources('udev') | 732 | test1.addSources('udev') |
2226 | 733 | getUtility(IArchivePermissionSet).newPackagesetUploader( | 733 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2227 | 734 | self.parent.main_archive, uploader, test1) | 734 | self.parent.main_archive, uploader, test1) |
2228 | 735 | child = self._fullInitialize([self.parent]) | 735 | child = self._fullInitialize([self.parent]) |
2229 | 736 | # We can fetch the copied sets from the child. | 736 | # We can fetch the copied sets from the child. |
2233 | 737 | child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') | 737 | child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2234 | 738 | child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2') | 738 | child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2') |
2235 | 739 | child_test3 = getUtility(IPackagesetSet).getByName(child, u'test3') | 739 | child_test3 = getUtility(IPackagesetSet).getByName(child, 'test3') |
2236 | 740 | # And we can see they are exact copies, with the related_set for the | 740 | # And we can see they are exact copies, with the related_set for the |
2237 | 741 | # copies pointing to the packageset in the parent. | 741 | # copies pointing to the packageset in the parent. |
2238 | 742 | self.assertEqual(test1.description, child_test1.description) | 742 | self.assertEqual(test1.description, child_test1.description) |
2239 | @@ -765,7 +765,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2240 | 765 | packages={'firefox': '3.1'}) | 765 | packages={'firefox': '3.1'}) |
2241 | 766 | uploader = self.factory.makePerson() | 766 | uploader = self.factory.makePerson() |
2242 | 767 | test1 = getUtility(IPackagesetSet).new( | 767 | test1 = getUtility(IPackagesetSet).new( |
2244 | 768 | u'test1', u'test 1 packageset', self.parent1.owner, | 768 | 'test1', 'test 1 packageset', self.parent1.owner, |
2245 | 769 | distroseries=self.parent1) | 769 | distroseries=self.parent1) |
2246 | 770 | test1.addSources('udev') | 770 | test1.addSources('udev') |
2247 | 771 | test1.addSources('firefox') | 771 | test1.addSources('firefox') |
2248 | @@ -782,7 +782,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2249 | 782 | s.sourcepackagerelease.version) | 782 | s.sourcepackagerelease.version) |
2250 | 783 | for s in published_sources) | 783 | for s in published_sources) |
2251 | 784 | self.assertContentEqual( | 784 | self.assertContentEqual( |
2253 | 785 | [(u'udev', u'0.1-1'), (u'firefox', u'2.1')], | 785 | [('udev', '0.1-1'), ('firefox', '2.1')], |
2254 | 786 | pub_sources) | 786 | pub_sources) |
2255 | 787 | 787 | ||
2256 | 788 | def test_copying_packagesets_no_duplication(self): | 788 | def test_copying_packagesets_no_duplication(self): |
2257 | @@ -792,7 +792,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2258 | 792 | parent = self._fullInitialize([previous_parent]) | 792 | parent = self._fullInitialize([previous_parent]) |
2259 | 793 | self.factory.makeSourcePackagePublishingHistory(distroseries=parent) | 793 | self.factory.makeSourcePackagePublishingHistory(distroseries=parent) |
2260 | 794 | p1, parent_packageset, _ = self.createPackageInPackageset( | 794 | p1, parent_packageset, _ = self.createPackageInPackageset( |
2262 | 795 | parent, u"p1", u"packageset") | 795 | parent, "p1", "packageset") |
2263 | 796 | uploader1 = self.factory.makePerson() | 796 | uploader1 = self.factory.makePerson() |
2264 | 797 | getUtility(IArchivePermissionSet).newPackagesetUploader( | 797 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2265 | 798 | parent.main_archive, uploader1, parent_packageset) | 798 | parent.main_archive, uploader1, parent_packageset) |
2266 | @@ -802,8 +802,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2267 | 802 | # Make sure the child's packageset has disjoint packages and | 802 | # Make sure the child's packageset has disjoint packages and |
2268 | 803 | # permissions. | 803 | # permissions. |
2269 | 804 | p2, child_packageset, _ = self.createPackageInPackageset( | 804 | p2, child_packageset, _ = self.createPackageInPackageset( |
2272 | 805 | child, u"p2", u"packageset") | 805 | child, "p2", "packageset") |
2273 | 806 | child_packageset.removeSources([u"p1"]) | 806 | child_packageset.removeSources(["p1"]) |
2274 | 807 | uploader2 = self.factory.makePerson() | 807 | uploader2 = self.factory.makePerson() |
2275 | 808 | getUtility(IArchivePermissionSet).newPackagesetUploader( | 808 | getUtility(IArchivePermissionSet).newPackagesetUploader( |
2276 | 809 | child.main_archive, uploader2, child_packageset) | 809 | child.main_archive, uploader2, child_packageset) |
2277 | @@ -834,7 +834,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2278 | 834 | uploader = self.factory.makePerson() | 834 | uploader = self.factory.makePerson() |
2279 | 835 | releaser = self.factory.makePerson() | 835 | releaser = self.factory.makePerson() |
2280 | 836 | test1 = self.factory.makePackageset( | 836 | test1 = self.factory.makePackageset( |
2282 | 837 | u'test1', u'test 1 packageset', parent.owner, | 837 | 'test1', 'test 1 packageset', parent.owner, |
2283 | 838 | distroseries=parent) | 838 | distroseries=parent) |
2284 | 839 | #test1 = getUtility(IPackagesetSet).new( | 839 | #test1 = getUtility(IPackagesetSet).new( |
2285 | 840 | # u'test1', u'test 1 packageset', self.parent.owner, | 840 | # u'test1', u'test 1 packageset', self.parent.owner, |
2286 | @@ -876,7 +876,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2287 | 876 | uploader = self.factory.makePerson() | 876 | uploader = self.factory.makePerson() |
2288 | 877 | releaser = self.factory.makePerson() | 877 | releaser = self.factory.makePerson() |
2289 | 878 | test1 = getUtility(IPackagesetSet).new( | 878 | test1 = getUtility(IPackagesetSet).new( |
2291 | 879 | u'test1', u'test 1 packageset', self.parent.owner, | 879 | 'test1', 'test 1 packageset', self.parent.owner, |
2292 | 880 | distroseries=self.parent) | 880 | distroseries=self.parent) |
2293 | 881 | test1.addSources('udev') | 881 | test1.addSources('udev') |
2294 | 882 | archive_permset = getUtility(IArchivePermissionSet) | 882 | archive_permset = getUtility(IArchivePermissionSet) |
2295 | @@ -1030,10 +1030,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2296 | 1030 | self.parent, self.parent_das = self.setupParent(packages={}) | 1030 | self.parent, self.parent_das = self.setupParent(packages={}) |
2297 | 1031 | ps_owner = self.factory.makePerson() | 1031 | ps_owner = self.factory.makePerson() |
2298 | 1032 | getUtility(IPackagesetSet).new( | 1032 | getUtility(IPackagesetSet).new( |
2300 | 1033 | u'ps', u'packageset', ps_owner, distroseries=self.parent) | 1033 | 'ps', 'packageset', ps_owner, distroseries=self.parent) |
2301 | 1034 | child = self._fullInitialize( | 1034 | child = self._fullInitialize( |
2302 | 1035 | [self.parent], distribution=self.parent.distribution) | 1035 | [self.parent], distribution=self.parent.distribution) |
2304 | 1036 | child_ps = getUtility(IPackagesetSet).getByName(child, u'ps') | 1036 | child_ps = getUtility(IPackagesetSet).getByName(child, 'ps') |
2305 | 1037 | self.assertEqual(ps_owner, child_ps.owner) | 1037 | self.assertEqual(ps_owner, child_ps.owner) |
2306 | 1038 | 1038 | ||
2307 | 1039 | def test_packageset_owner_not_preserved_cross_distro(self): | 1039 | def test_packageset_owner_not_preserved_cross_distro(self): |
2308 | @@ -1041,10 +1041,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2309 | 1041 | # packagesets are owned by the new distro owner. | 1041 | # packagesets are owned by the new distro owner. |
2310 | 1042 | self.parent, self.parent_das = self.setupParent() | 1042 | self.parent, self.parent_das = self.setupParent() |
2311 | 1043 | getUtility(IPackagesetSet).new( | 1043 | getUtility(IPackagesetSet).new( |
2313 | 1044 | u'ps', u'packageset', self.factory.makePerson(), | 1044 | 'ps', 'packageset', self.factory.makePerson(), |
2314 | 1045 | distroseries=self.parent) | 1045 | distroseries=self.parent) |
2315 | 1046 | child = self._fullInitialize([self.parent]) | 1046 | child = self._fullInitialize([self.parent]) |
2317 | 1047 | child_ps = getUtility(IPackagesetSet).getByName(child, u'ps') | 1047 | child_ps = getUtility(IPackagesetSet).getByName(child, 'ps') |
2318 | 1048 | self.assertEqual(child.owner, child_ps.owner) | 1048 | self.assertEqual(child.owner, child_ps.owner) |
2319 | 1049 | 1049 | ||
2320 | 1050 | def test_copy_limit_packagesets(self): | 1050 | def test_copy_limit_packagesets(self): |
2321 | @@ -1052,23 +1052,23 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2322 | 1052 | # want to copy. | 1052 | # want to copy. |
2323 | 1053 | self.parent, self.parent_das = self.setupParent() | 1053 | self.parent, self.parent_das = self.setupParent() |
2324 | 1054 | test1 = getUtility(IPackagesetSet).new( | 1054 | test1 = getUtility(IPackagesetSet).new( |
2326 | 1055 | u'test1', u'test 1 packageset', self.parent.owner, | 1055 | 'test1', 'test 1 packageset', self.parent.owner, |
2327 | 1056 | distroseries=self.parent) | 1056 | distroseries=self.parent) |
2328 | 1057 | getUtility(IPackagesetSet).new( | 1057 | getUtility(IPackagesetSet).new( |
2330 | 1058 | u'test2', u'test 2 packageset', self.parent.owner, | 1058 | 'test2', 'test 2 packageset', self.parent.owner, |
2331 | 1059 | distroseries=self.parent) | 1059 | distroseries=self.parent) |
2332 | 1060 | packages = ('udev', 'chromium', 'libc6') | 1060 | packages = ('udev', 'chromium', 'libc6') |
2333 | 1061 | for pkg in packages: | 1061 | for pkg in packages: |
2334 | 1062 | test1.addSources(pkg) | 1062 | test1.addSources(pkg) |
2335 | 1063 | packageset1 = getUtility(IPackagesetSet).getByName( | 1063 | packageset1 = getUtility(IPackagesetSet).getByName( |
2337 | 1064 | self.parent, u'test1') | 1064 | self.parent, 'test1') |
2338 | 1065 | child = self._fullInitialize( | 1065 | child = self._fullInitialize( |
2339 | 1066 | [self.parent], packagesets=(str(packageset1.id),)) | 1066 | [self.parent], packagesets=(str(packageset1.id),)) |
2341 | 1067 | child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') | 1067 | child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2342 | 1068 | self.assertEqual(test1.description, child_test1.description) | 1068 | self.assertEqual(test1.description, child_test1.description) |
2343 | 1069 | self.assertRaises( | 1069 | self.assertRaises( |
2344 | 1070 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, | 1070 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2346 | 1071 | child, u'test2') | 1071 | child, 'test2') |
2347 | 1072 | parent_srcs = test1.getSourcesIncluded(direct_inclusion=True) | 1072 | parent_srcs = test1.getSourcesIncluded(direct_inclusion=True) |
2348 | 1073 | child_srcs = child_test1.getSourcesIncluded( | 1073 | child_srcs = child_test1.getSourcesIncluded( |
2349 | 1074 | direct_inclusion=True) | 1074 | direct_inclusion=True) |
2350 | @@ -1081,10 +1081,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2351 | 1081 | # If a parent series has packagesets, we don't want to copy any of them | 1081 | # If a parent series has packagesets, we don't want to copy any of them |
2352 | 1082 | self.parent, self.parent_das = self.setupParent() | 1082 | self.parent, self.parent_das = self.setupParent() |
2353 | 1083 | test1 = getUtility(IPackagesetSet).new( | 1083 | test1 = getUtility(IPackagesetSet).new( |
2355 | 1084 | u'test1', u'test 1 packageset', self.parent.owner, | 1084 | 'test1', 'test 1 packageset', self.parent.owner, |
2356 | 1085 | distroseries=self.parent) | 1085 | distroseries=self.parent) |
2357 | 1086 | getUtility(IPackagesetSet).new( | 1086 | getUtility(IPackagesetSet).new( |
2359 | 1087 | u'test2', u'test 2 packageset', self.parent.owner, | 1087 | 'test2', 'test 2 packageset', self.parent.owner, |
2360 | 1088 | distroseries=self.parent) | 1088 | distroseries=self.parent) |
2361 | 1089 | packages = ('udev', 'chromium', 'libc6') | 1089 | packages = ('udev', 'chromium', 'libc6') |
2362 | 1090 | for pkg in packages: | 1090 | for pkg in packages: |
2363 | @@ -1093,10 +1093,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2364 | 1093 | [self.parent], packagesets=[]) | 1093 | [self.parent], packagesets=[]) |
2365 | 1094 | self.assertRaises( | 1094 | self.assertRaises( |
2366 | 1095 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, | 1095 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2368 | 1096 | child, u'test1') | 1096 | child, 'test1') |
2369 | 1097 | self.assertRaises( | 1097 | self.assertRaises( |
2370 | 1098 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, | 1098 | NoSuchPackageSet, getUtility(IPackagesetSet).getByName, |
2372 | 1099 | child, u'test2') | 1099 | child, 'test2') |
2373 | 1100 | self.assertEqual(child.sourcecount, 0) | 1100 | self.assertEqual(child.sourcecount, 0) |
2374 | 1101 | self.assertEqual(child.binarycount, 0) | 1101 | self.assertEqual(child.binarycount, 0) |
2375 | 1102 | 1102 | ||
2376 | @@ -1104,10 +1104,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2377 | 1104 | # If a parent series has packagesets, we want to copy all of them | 1104 | # If a parent series has packagesets, we want to copy all of them |
2378 | 1105 | self.parent, self.parent_das = self.setupParent() | 1105 | self.parent, self.parent_das = self.setupParent() |
2379 | 1106 | test1 = getUtility(IPackagesetSet).new( | 1106 | test1 = getUtility(IPackagesetSet).new( |
2381 | 1107 | u'test1', u'test 1 packageset', self.parent.owner, | 1107 | 'test1', 'test 1 packageset', self.parent.owner, |
2382 | 1108 | distroseries=self.parent) | 1108 | distroseries=self.parent) |
2383 | 1109 | test2 = getUtility(IPackagesetSet).new( | 1109 | test2 = getUtility(IPackagesetSet).new( |
2385 | 1110 | u'test2', u'test 2 packageset', self.parent.owner, | 1110 | 'test2', 'test 2 packageset', self.parent.owner, |
2386 | 1111 | distroseries=self.parent) | 1111 | distroseries=self.parent) |
2387 | 1112 | packages_test1 = ('udev', 'chromium', 'libc6') | 1112 | packages_test1 = ('udev', 'chromium', 'libc6') |
2388 | 1113 | packages_test2 = ('postgresql', 'vim') | 1113 | packages_test2 = ('postgresql', 'vim') |
2389 | @@ -1117,8 +1117,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2390 | 1117 | test2.addSources(pkg) | 1117 | test2.addSources(pkg) |
2391 | 1118 | child = self._fullInitialize( | 1118 | child = self._fullInitialize( |
2392 | 1119 | [self.parent], packagesets=None) | 1119 | [self.parent], packagesets=None) |
2395 | 1120 | child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') | 1120 | child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2396 | 1121 | child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2') | 1121 | child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2') |
2397 | 1122 | self.assertEqual(test1.description, child_test1.description) | 1122 | self.assertEqual(test1.description, child_test1.description) |
2398 | 1123 | self.assertEqual(test2.description, child_test2.description) | 1123 | self.assertEqual(test2.description, child_test2.description) |
2399 | 1124 | parent_srcs_test1 = test1.getSourcesIncluded(direct_inclusion=True) | 1124 | parent_srcs_test1 = test1.getSourcesIncluded(direct_inclusion=True) |
2400 | @@ -1139,7 +1139,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2401 | 1139 | # the packaging links for the copied packages are copied. | 1139 | # the packaging links for the copied packages are copied. |
2402 | 1140 | packages_test1, packages_test2 = self.setupPackagingTesting() | 1140 | packages_test1, packages_test2 = self.setupPackagingTesting() |
2403 | 1141 | packageset1 = getUtility(IPackagesetSet).getByName( | 1141 | packageset1 = getUtility(IPackagesetSet).getByName( |
2405 | 1142 | self.parent, u'test1') | 1142 | self.parent, 'test1') |
2406 | 1143 | child = self._fullInitialize( | 1143 | child = self._fullInitialize( |
2407 | 1144 | [self.parent], packagesets=(str(packageset1.id),)) | 1144 | [self.parent], packagesets=(str(packageset1.id),)) |
2408 | 1145 | packagings = child.getMostRecentlyLinkedPackagings() | 1145 | packagings = child.getMostRecentlyLinkedPackagings() |
2409 | @@ -1197,10 +1197,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2410 | 1197 | # for the copied source will be created. | 1197 | # for the copied source will be created. |
2411 | 1198 | self.parent, self.parent_das = self.setupParent() | 1198 | self.parent, self.parent_das = self.setupParent() |
2412 | 1199 | test1 = getUtility(IPackagesetSet).new( | 1199 | test1 = getUtility(IPackagesetSet).new( |
2414 | 1200 | u'test1', u'test 1 packageset', self.parent.owner, | 1200 | 'test1', 'test 1 packageset', self.parent.owner, |
2415 | 1201 | distroseries=self.parent) | 1201 | distroseries=self.parent) |
2416 | 1202 | getUtility(IPackagesetSet).new( | 1202 | getUtility(IPackagesetSet).new( |
2418 | 1203 | u'test2', u'test 2 packageset', self.parent.owner, | 1203 | 'test2', 'test 2 packageset', self.parent.owner, |
2419 | 1204 | distroseries=self.parent) | 1204 | distroseries=self.parent) |
2420 | 1205 | packages = ('udev', 'chromium') | 1205 | packages = ('udev', 'chromium') |
2421 | 1206 | for pkg in packages: | 1206 | for pkg in packages: |
2422 | @@ -1331,10 +1331,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2423 | 1331 | uploader1 = self.factory.makePerson() | 1331 | uploader1 = self.factory.makePerson() |
2424 | 1332 | uploader2 = self.factory.makePerson() | 1332 | uploader2 = self.factory.makePerson() |
2425 | 1333 | test1_parent1 = getUtility(IPackagesetSet).new( | 1333 | test1_parent1 = getUtility(IPackagesetSet).new( |
2427 | 1334 | u'test1', u'test 1 packageset', self.parent1.owner, | 1334 | 'test1', 'test 1 packageset', self.parent1.owner, |
2428 | 1335 | distroseries=self.parent1) | 1335 | distroseries=self.parent1) |
2429 | 1336 | test1_parent2 = getUtility(IPackagesetSet).new( | 1336 | test1_parent2 = getUtility(IPackagesetSet).new( |
2431 | 1337 | u'test1', u'test 1 packageset', self.parent2.owner, | 1337 | 'test1', 'test 1 packageset', self.parent2.owner, |
2432 | 1338 | distroseries=self.parent2) | 1338 | distroseries=self.parent2) |
2433 | 1339 | test1_parent1.addSources('chromium') | 1339 | test1_parent1.addSources('chromium') |
2434 | 1340 | test1_parent1.addSources('udev') | 1340 | test1_parent1.addSources('udev') |
2435 | @@ -1347,7 +1347,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2436 | 1347 | child = self._fullInitialize([self.parent1, self.parent2]) | 1347 | child = self._fullInitialize([self.parent1, self.parent2]) |
2437 | 1348 | 1348 | ||
2438 | 1349 | # In the child, the identical packagesets are merged into one. | 1349 | # In the child, the identical packagesets are merged into one. |
2440 | 1350 | child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1') | 1350 | child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1') |
2441 | 1351 | child_srcs = child_test1.getSourcesIncluded( | 1351 | child_srcs = child_test1.getSourcesIncluded( |
2442 | 1352 | direct_inclusion=True) | 1352 | direct_inclusion=True) |
2443 | 1353 | parent1_srcs = test1_parent1.getSourcesIncluded(direct_inclusion=True) | 1353 | parent1_srcs = test1_parent1.getSourcesIncluded(direct_inclusion=True) |
2444 | @@ -1449,8 +1449,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2445 | 1449 | # If the series to be initialized is in a distribution with | 1449 | # If the series to be initialized is in a distribution with |
2446 | 1450 | # initialized series, the series is *derived* from | 1450 | # initialized series, the series is *derived* from |
2447 | 1451 | # the previous_series' parents. | 1451 | # the previous_series' parents. |
2450 | 1452 | previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1452 | previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2451 | 1453 | previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1453 | previous_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2452 | 1454 | child = self.setUpSeriesWithPreviousSeries( | 1454 | child = self.setUpSeriesWithPreviousSeries( |
2453 | 1455 | previous_parents=[previous_parent1, previous_parent2]) | 1455 | previous_parents=[previous_parent1, previous_parent2]) |
2454 | 1456 | parent, unused = self.setupParent() | 1456 | parent, unused = self.setupParent() |
2455 | @@ -1471,14 +1471,14 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2456 | 1471 | s.sourcepackagerelease.version) | 1471 | s.sourcepackagerelease.version) |
2457 | 1472 | for s in published_sources) | 1472 | for s in published_sources) |
2458 | 1473 | self.assertEqual( | 1473 | self.assertEqual( |
2460 | 1474 | [(u'p1', u'1.2'), (u'p2', u'1.5')], | 1474 | [('p1', '1.2'), ('p2', '1.5')], |
2461 | 1475 | pub_sources) | 1475 | pub_sources) |
2462 | 1476 | 1476 | ||
2463 | 1477 | def test_derive_from_previous_parents_empty_parents(self): | 1477 | def test_derive_from_previous_parents_empty_parents(self): |
2464 | 1478 | # If an empty list is passed to InitializeDistroSeries, the | 1478 | # If an empty list is passed to InitializeDistroSeries, the |
2465 | 1479 | # parents of the previous series are used as parents. | 1479 | # parents of the previous series are used as parents. |
2468 | 1480 | previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1480 | previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2469 | 1481 | previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1481 | previous_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2470 | 1482 | child = self.setUpSeriesWithPreviousSeries( | 1482 | child = self.setUpSeriesWithPreviousSeries( |
2471 | 1483 | previous_parents=[previous_parent1, previous_parent2]) | 1483 | previous_parents=[previous_parent1, previous_parent2]) |
2472 | 1484 | # Initialize from an empty list of parents. | 1484 | # Initialize from an empty list of parents. |
2473 | @@ -1491,7 +1491,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2474 | 1491 | def test_derive_empty_parents_distribution_not_initialized(self): | 1491 | def test_derive_empty_parents_distribution_not_initialized(self): |
2475 | 1492 | # Initializing a series with an empty parent list if the series' | 1492 | # Initializing a series with an empty parent list if the series' |
2476 | 1493 | # distribution has no initialized series triggers an error. | 1493 | # distribution has no initialized series triggers an error. |
2478 | 1494 | previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1494 | previous_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2479 | 1495 | child = self.setUpSeriesWithPreviousSeries( | 1495 | child = self.setUpSeriesWithPreviousSeries( |
2480 | 1496 | previous_parents=[previous_parent1], | 1496 | previous_parents=[previous_parent1], |
2481 | 1497 | publish_in_distribution=False, | 1497 | publish_in_distribution=False, |
2482 | @@ -1601,7 +1601,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2483 | 1601 | # The new publishings, copied over from the parents, have their | 1601 | # The new publishings, copied over from the parents, have their |
2484 | 1602 | # 'creator' field set to None. This tests that behaviour when | 1602 | # 'creator' field set to None. This tests that behaviour when |
2485 | 1603 | # the cloner is used to perform the initialization. | 1603 | # the cloner is used to perform the initialization. |
2487 | 1604 | parent, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1604 | parent, unused = self.setupParent(packages={'p1': '1.2'}) |
2488 | 1605 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) | 1605 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) |
2489 | 1606 | self.factory.makeSourcePackagePublishingHistory(distroseries=child) | 1606 | self.factory.makeSourcePackagePublishingHistory(distroseries=child) |
2490 | 1607 | self._fullInitialize([parent], child=child) | 1607 | self._fullInitialize([parent], child=child) |
2491 | @@ -1614,7 +1614,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2492 | 1614 | # The new publishings, copied over from the parents, have their | 1614 | # The new publishings, copied over from the parents, have their |
2493 | 1615 | # 'creator' field set to None. This tests that behaviour when | 1615 | # 'creator' field set to None. This tests that behaviour when |
2494 | 1616 | # the copier is used to perform the initialization. | 1616 | # the copier is used to perform the initialization. |
2496 | 1617 | parent, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1617 | parent, unused = self.setupParent(packages={'p1': '1.2'}) |
2497 | 1618 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) | 1618 | child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent]) |
2498 | 1619 | self._fullInitialize([parent], child=child) | 1619 | self._fullInitialize([parent], child=child) |
2499 | 1620 | 1620 | ||
2500 | @@ -1626,8 +1626,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2501 | 1626 | # IDS._has_same_parents_as_previous_series returns True if the | 1626 | # IDS._has_same_parents_as_previous_series returns True if the |
2502 | 1627 | # parents for the series to be initialized are the same as | 1627 | # parents for the series to be initialized are the same as |
2503 | 1628 | # previous_series' parents. | 1628 | # previous_series' parents. |
2506 | 1629 | prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1629 | prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2507 | 1630 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1630 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2508 | 1631 | child = self.setUpSeriesWithPreviousSeries( | 1631 | child = self.setUpSeriesWithPreviousSeries( |
2509 | 1632 | previous_parents=[prev_parent1, prev_parent2]) | 1632 | previous_parents=[prev_parent1, prev_parent2]) |
2510 | 1633 | # The same parents can be explicitely set. | 1633 | # The same parents can be explicitely set. |
2511 | @@ -1640,8 +1640,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2512 | 1640 | # IDS._has_same_parents_as_previous_series returns True if the | 1640 | # IDS._has_same_parents_as_previous_series returns True if the |
2513 | 1641 | # parents for the series to be initialized are the same as | 1641 | # parents for the series to be initialized are the same as |
2514 | 1642 | # previous_series' parents. | 1642 | # previous_series' parents. |
2517 | 1643 | prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1643 | prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2518 | 1644 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1644 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2519 | 1645 | child = self.setUpSeriesWithPreviousSeries( | 1645 | child = self.setUpSeriesWithPreviousSeries( |
2520 | 1646 | previous_parents=[prev_parent1, prev_parent2]) | 1646 | previous_parents=[prev_parent1, prev_parent2]) |
2521 | 1647 | # If no parents are provided, the parents from previous_series | 1647 | # If no parents are provided, the parents from previous_series |
2522 | @@ -1654,8 +1654,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2523 | 1654 | # IDS._has_same_parents_as_previous_series returns False if the | 1654 | # IDS._has_same_parents_as_previous_series returns False if the |
2524 | 1655 | # parents for the series to be initialized are *not* the same as | 1655 | # parents for the series to be initialized are *not* the same as |
2525 | 1656 | # previous_series' parents. | 1656 | # previous_series' parents. |
2528 | 1657 | prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1657 | prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2529 | 1658 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1658 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2530 | 1659 | child = self.setUpSeriesWithPreviousSeries( | 1659 | child = self.setUpSeriesWithPreviousSeries( |
2531 | 1660 | previous_parents=[prev_parent1, prev_parent2]) | 1660 | previous_parents=[prev_parent1, prev_parent2]) |
2532 | 1661 | parent3 = self.factory.makeDistroSeries() | 1661 | parent3 = self.factory.makeDistroSeries() |
2533 | @@ -1668,24 +1668,24 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2534 | 1668 | # Post-first initialization of a series with the same parents | 1668 | # Post-first initialization of a series with the same parents |
2535 | 1669 | # than those of the previous_series causes a copy of | 1669 | # than those of the previous_series causes a copy of |
2536 | 1670 | # previous_series' DSDs. | 1670 | # previous_series' DSDs. |
2539 | 1671 | prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1671 | prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2540 | 1672 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1672 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2541 | 1673 | child = self.setUpSeriesWithPreviousSeries( | 1673 | child = self.setUpSeriesWithPreviousSeries( |
2542 | 1674 | previous_parents=[prev_parent1, prev_parent2]) | 1674 | previous_parents=[prev_parent1, prev_parent2]) |
2543 | 1675 | self.factory.makeDistroSeriesDifference() | 1675 | self.factory.makeDistroSeriesDifference() |
2544 | 1676 | self.factory.makeDistroSeriesDifference( | 1676 | self.factory.makeDistroSeriesDifference( |
2545 | 1677 | derived_series=child.previous_series, | 1677 | derived_series=child.previous_series, |
2547 | 1678 | source_package_name_str=u'p1') | 1678 | source_package_name_str='p1') |
2548 | 1679 | self.factory.makeDistroSeriesDifference( | 1679 | self.factory.makeDistroSeriesDifference( |
2549 | 1680 | derived_series=child.previous_series, | 1680 | derived_series=child.previous_series, |
2551 | 1681 | source_package_name_str=u'p2') | 1681 | source_package_name_str='p2') |
2552 | 1682 | dsd_source = getUtility(IDistroSeriesDifferenceSource) | 1682 | dsd_source = getUtility(IDistroSeriesDifferenceSource) |
2553 | 1683 | # No DSDs for the child yet. | 1683 | # No DSDs for the child yet. |
2554 | 1684 | self.assertEqual(0, dsd_source.getForDistroSeries(child).count()) | 1684 | self.assertEqual(0, dsd_source.getForDistroSeries(child).count()) |
2555 | 1685 | self._fullInitialize([], child=child) | 1685 | self._fullInitialize([], child=child) |
2556 | 1686 | 1686 | ||
2557 | 1687 | self.assertContentEqual( | 1687 | self.assertContentEqual( |
2559 | 1688 | [u'p1', u'p2'], | 1688 | ['p1', 'p2'], |
2560 | 1689 | [ | 1689 | [ |
2561 | 1690 | diff.source_package_name.name | 1690 | diff.source_package_name.name |
2562 | 1691 | for diff in dsd_source.getForDistroSeries(child)]) | 1691 | for diff in dsd_source.getForDistroSeries(child)]) |
2563 | @@ -1704,8 +1704,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2564 | 1704 | def test_initialization_first_deriv_create_dsdjs(self): | 1704 | def test_initialization_first_deriv_create_dsdjs(self): |
2565 | 1705 | # A first initialization of a series creates the creation | 1705 | # A first initialization of a series creates the creation |
2566 | 1706 | # of the DSDJs with all the parents. | 1706 | # of the DSDJs with all the parents. |
2569 | 1707 | parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1707 | parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2570 | 1708 | parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1708 | parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2571 | 1709 | child = self._fullInitialize([parent1, parent2]) | 1709 | child = self._fullInitialize([parent1, parent2]) |
2572 | 1710 | 1710 | ||
2573 | 1711 | self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1)) | 1711 | self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1)) |
2574 | @@ -1715,12 +1715,12 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2575 | 1715 | # Post-first initialization of a series with different parents | 1715 | # Post-first initialization of a series with different parents |
2576 | 1716 | # than those of the previous_series creates the DSDJs to | 1716 | # than those of the previous_series creates the DSDJs to |
2577 | 1717 | # compute the DSDs with the parents. | 1717 | # compute the DSDs with the parents. |
2580 | 1718 | prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'}) | 1718 | prev_parent1, unused = self.setupParent(packages={'p1': '1.2'}) |
2581 | 1719 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1719 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2582 | 1720 | child = self.setUpSeriesWithPreviousSeries( | 1720 | child = self.setUpSeriesWithPreviousSeries( |
2583 | 1721 | previous_parents=[prev_parent1, prev_parent2]) | 1721 | previous_parents=[prev_parent1, prev_parent2]) |
2584 | 1722 | parent3, unused = self.setupParent( | 1722 | parent3, unused = self.setupParent( |
2586 | 1723 | packages={u'p2': u'2.5', u'p3': u'1.1'}) | 1723 | packages={'p2': '2.5', 'p3': '1.1'}) |
2587 | 1724 | self._fullInitialize( | 1724 | self._fullInitialize( |
2588 | 1725 | [prev_parent1, prev_parent2, parent3], child=child) | 1725 | [prev_parent1, prev_parent2, parent3], child=child) |
2589 | 1726 | 1726 | ||
2590 | @@ -1736,16 +1736,16 @@ class TestInitializeDistroSeries(InitializationHelperTestCase): | |||
2591 | 1736 | # packagesets creates the DSDJs for the packages inside these | 1736 | # packagesets creates the DSDJs for the packages inside these |
2592 | 1737 | # packagesets. | 1737 | # packagesets. |
2593 | 1738 | prev_parent1, unused = self.setupParent( | 1738 | prev_parent1, unused = self.setupParent( |
2596 | 1739 | packages={u'p1': u'1.2', u'p11': u'3.1'}) | 1739 | packages={'p1': '1.2', 'p11': '3.1'}) |
2597 | 1740 | prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'}) | 1740 | prev_parent2, unused = self.setupParent(packages={'p2': '1.5'}) |
2598 | 1741 | child = self.setUpSeriesWithPreviousSeries( | 1741 | child = self.setUpSeriesWithPreviousSeries( |
2599 | 1742 | previous_parents=[prev_parent1, prev_parent2]) | 1742 | previous_parents=[prev_parent1, prev_parent2]) |
2600 | 1743 | test1 = getUtility(IPackagesetSet).new( | 1743 | test1 = getUtility(IPackagesetSet).new( |
2602 | 1744 | u'test1', u'test 1 packageset', child.previous_series.owner, | 1744 | 'test1', 'test 1 packageset', child.previous_series.owner, |
2603 | 1745 | distroseries=child.previous_series) | 1745 | distroseries=child.previous_series) |
2604 | 1746 | test1.addSources('p1') | 1746 | test1.addSources('p1') |
2605 | 1747 | parent3, unused = self.setupParent( | 1747 | parent3, unused = self.setupParent( |
2607 | 1748 | packages={u'p1': u'2.5', u'p3': u'4.4'}) | 1748 | packages={'p1': '2.5', 'p3': '4.4'}) |
2608 | 1749 | self._fullInitialize( | 1749 | self._fullInitialize( |
2609 | 1750 | [prev_parent1, prev_parent2, parent3], child=child, | 1750 | [prev_parent1, prev_parent2, parent3], child=child, |
2610 | 1751 | packagesets=(str(test1.id),)) | 1751 | packagesets=(str(test1.id),)) |
2611 | diff --git a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py | |||
2612 | index 166f5db..f296c35 100644 | |||
2613 | --- a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py | |||
2614 | +++ b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py | |||
2615 | @@ -71,7 +71,7 @@ class TestObsoleteDistroseries(TestCaseWithFactory): | |||
2616 | 71 | 71 | ||
2617 | 72 | def setUp(self): | 72 | def setUp(self): |
2618 | 73 | """Set up test data common to all test cases.""" | 73 | """Set up test data common to all test cases.""" |
2620 | 74 | super(TestObsoleteDistroseries, self).setUp() | 74 | super().setUp() |
2621 | 75 | self.warty = getUtility(IDistributionSet)['ubuntu']['warty'] | 75 | self.warty = getUtility(IDistributionSet)['ubuntu']['warty'] |
2622 | 76 | 76 | ||
2623 | 77 | # Re-process the returned list otherwise it ends up being a list | 77 | # Re-process the returned list otherwise it ends up being a list |
2624 | diff --git a/lib/lp/soyuz/scripts/tests/test_populatearchive.py b/lib/lp/soyuz/scripts/tests/test_populatearchive.py | |||
2625 | index c3b810f..d2826a3 100644 | |||
2626 | --- a/lib/lp/soyuz/scripts/tests/test_populatearchive.py | |||
2627 | +++ b/lib/lp/soyuz/scripts/tests/test_populatearchive.py | |||
2628 | @@ -46,14 +46,14 @@ class TestPopulateArchiveScript(TestCaseWithFactory): | |||
2629 | 46 | 46 | ||
2630 | 47 | layer = LaunchpadZopelessLayer | 47 | layer = LaunchpadZopelessLayer |
2631 | 48 | expected_build_spns = [ | 48 | expected_build_spns = [ |
2634 | 49 | u'alsa-utils', u'cnews', u'evolution', u'libstdc++', | 49 | 'alsa-utils', 'cnews', 'evolution', 'libstdc++', |
2635 | 50 | u'linux-source-2.6.15', u'netapplet'] | 50 | 'linux-source-2.6.15', 'netapplet'] |
2636 | 51 | expected_src_names = [ | 51 | expected_src_names = [ |
2642 | 52 | u'alsa-utils 1.0.9a-4ubuntu1 in hoary', | 52 | 'alsa-utils 1.0.9a-4ubuntu1 in hoary', |
2643 | 53 | u'cnews cr.g7-37 in hoary', u'evolution 1.0 in hoary', | 53 | 'cnews cr.g7-37 in hoary', 'evolution 1.0 in hoary', |
2644 | 54 | u'libstdc++ b8p in hoary', | 54 | 'libstdc++ b8p in hoary', |
2645 | 55 | u'linux-source-2.6.15 2.6.15.3 in hoary', | 55 | 'linux-source-2.6.15 2.6.15.3 in hoary', |
2646 | 56 | u'netapplet 1.0-1 in hoary', u'pmount 0.1-2 in hoary'] | 56 | 'netapplet 1.0-1 in hoary', 'pmount 0.1-2 in hoary'] |
2647 | 57 | pending_statuses = ( | 57 | pending_statuses = ( |
2648 | 58 | PackagePublishingStatus.PENDING, | 58 | PackagePublishingStatus.PENDING, |
2649 | 59 | PackagePublishingStatus.PUBLISHED) | 59 | PackagePublishingStatus.PUBLISHED) |
2650 | @@ -675,7 +675,7 @@ class TestPopulateArchiveScript(TestCaseWithFactory): | |||
2651 | 675 | archive=ubuntu.main_archive) | 675 | archive=ubuntu.main_archive) |
2652 | 676 | sources = ubuntu.main_archive.getPublishedSources( | 676 | sources = ubuntu.main_archive.getPublishedSources( |
2653 | 677 | distroseries=hoary, status=self.pending_statuses, | 677 | distroseries=hoary, status=self.pending_statuses, |
2655 | 678 | name=u'alsa-utils') | 678 | name='alsa-utils') |
2656 | 679 | for src in sources: | 679 | for src in sources: |
2657 | 680 | if src.source_package_version != '2.0': | 680 | if src.source_package_version != '2.0': |
2658 | 681 | src.supersede() | 681 | src.supersede() |
2659 | diff --git a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py | |||
2660 | index 50db145..c56a4ab 100644 | |||
2661 | --- a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py | |||
2662 | +++ b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py | |||
2663 | @@ -71,7 +71,7 @@ class TestScriptRunning(TestCaseWithFactory): | |||
2664 | 71 | layer = LaunchpadZopelessLayer | 71 | layer = LaunchpadZopelessLayer |
2665 | 72 | 72 | ||
2666 | 73 | def setUp(self): | 73 | def setUp(self): |
2668 | 74 | super(TestScriptRunning, self).setUp() | 74 | super().setUp() |
2669 | 75 | self.publisher = SoyuzTestPublisher() | 75 | self.publisher = SoyuzTestPublisher() |
2670 | 76 | self.publisher.prepareBreezyAutotest() | 76 | self.publisher.prepareBreezyAutotest() |
2671 | 77 | 77 | ||
2672 | diff --git a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py | |||
2673 | index 26b518e..24b2462 100644 | |||
2674 | --- a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py | |||
2675 | +++ b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py | |||
2676 | @@ -23,7 +23,7 @@ class TestRetryDepwait(TestCaseWithFactory): | |||
2677 | 23 | layer = ZopelessDatabaseLayer | 23 | layer = ZopelessDatabaseLayer |
2678 | 24 | 24 | ||
2679 | 25 | def setUp(self): | 25 | def setUp(self): |
2681 | 26 | super(TestRetryDepwait, self).setUp() | 26 | super().setUp() |
2682 | 27 | self.chroot = getUtility(ILibraryFileAliasSet)[1] | 27 | self.chroot = getUtility(ILibraryFileAliasSet)[1] |
2683 | 28 | self.build = removeSecurityProxy( | 28 | self.build = removeSecurityProxy( |
2684 | 29 | self.factory.makeBinaryPackageBuild( | 29 | self.factory.makeBinaryPackageBuild( |
2685 | @@ -48,7 +48,7 @@ class TestRetryDepwait(TestCaseWithFactory): | |||
2686 | 48 | # Builds with unsatisfied dependencies are not retried. | 48 | # Builds with unsatisfied dependencies are not retried. |
2687 | 49 | self.build.updateStatus( | 49 | self.build.updateStatus( |
2688 | 50 | BuildStatus.MANUALDEPWAIT, | 50 | BuildStatus.MANUALDEPWAIT, |
2690 | 51 | slave_status={'dependencies': u'something'}) | 51 | slave_status={'dependencies': 'something'}) |
2691 | 52 | self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT) | 52 | self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT) |
2692 | 53 | self.assertEqual(1, self.build.updateDependencies.call_count) | 53 | self.assertEqual(1, self.build.updateDependencies.call_count) |
2693 | 54 | 54 | ||
2694 | diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py | |||
2695 | index ac1fb04..9e7be9a 100644 | |||
2696 | --- a/lib/lp/soyuz/tests/test_archive.py | |||
2697 | +++ b/lib/lp/soyuz/tests/test_archive.py | |||
2698 | @@ -15,7 +15,6 @@ import os.path | |||
2699 | 15 | from aptsources.sourceslist import SourceEntry | 15 | from aptsources.sourceslist import SourceEntry |
2700 | 16 | from pytz import UTC | 16 | from pytz import UTC |
2701 | 17 | import responses | 17 | import responses |
2702 | 18 | import six | ||
2703 | 19 | from six.moves.urllib.parse import urlsplit | 18 | from six.moves.urllib.parse import urlsplit |
2704 | 20 | from storm.store import Store | 19 | from storm.store import Store |
2705 | 21 | from testtools.matchers import ( | 20 | from testtools.matchers import ( |
2706 | @@ -1048,7 +1047,7 @@ class TestUpdatePackageDownloadCount(TestCaseWithFactory): | |||
2707 | 1048 | layer = LaunchpadZopelessLayer | 1047 | layer = LaunchpadZopelessLayer |
2708 | 1049 | 1048 | ||
2709 | 1050 | def setUp(self): | 1049 | def setUp(self): |
2711 | 1051 | super(TestUpdatePackageDownloadCount, self).setUp() | 1050 | super().setUp() |
2712 | 1052 | self.publisher = SoyuzTestPublisher() | 1051 | self.publisher = SoyuzTestPublisher() |
2713 | 1053 | self.publisher.prepareBreezyAutotest() | 1052 | self.publisher.prepareBreezyAutotest() |
2714 | 1054 | 1053 | ||
2715 | @@ -1155,7 +1154,7 @@ class TestProcessors(TestCaseWithFactory): | |||
2716 | 1155 | 1154 | ||
2717 | 1156 | def setUp(self): | 1155 | def setUp(self): |
2718 | 1157 | """Setup an archive with relevant publications.""" | 1156 | """Setup an archive with relevant publications.""" |
2720 | 1158 | super(TestProcessors, self).setUp(user='foo.bar@canonical.com') | 1157 | super().setUp(user='foo.bar@canonical.com') |
2721 | 1159 | self.publisher = SoyuzTestPublisher() | 1158 | self.publisher = SoyuzTestPublisher() |
2722 | 1160 | self.publisher.prepareBreezyAutotest() | 1159 | self.publisher.prepareBreezyAutotest() |
2723 | 1161 | self.archive = self.factory.makeArchive() | 1160 | self.archive = self.factory.makeArchive() |
2724 | @@ -1287,7 +1286,7 @@ class TestArchiveTokens(TestCaseWithFactory): | |||
2725 | 1287 | layer = LaunchpadZopelessLayer | 1286 | layer = LaunchpadZopelessLayer |
2726 | 1288 | 1287 | ||
2727 | 1289 | def setUp(self): | 1288 | def setUp(self): |
2729 | 1290 | super(TestArchiveTokens, self).setUp() | 1289 | super().setUp() |
2730 | 1291 | owner = self.factory.makePerson() | 1290 | owner = self.factory.makePerson() |
2731 | 1292 | self.private_ppa = self.factory.makeArchive(owner=owner, private=True) | 1291 | self.private_ppa = self.factory.makeArchive(owner=owner, private=True) |
2732 | 1293 | self.joe = self.factory.makePerson(name='joe') | 1292 | self.joe = self.factory.makePerson(name='joe') |
2733 | @@ -1454,7 +1453,7 @@ class TestGetBinaryPackageRelease(TestCaseWithFactory): | |||
2734 | 1454 | 1453 | ||
2735 | 1455 | def setUp(self): | 1454 | def setUp(self): |
2736 | 1456 | """Setup an archive with relevant publications.""" | 1455 | """Setup an archive with relevant publications.""" |
2738 | 1457 | super(TestGetBinaryPackageRelease, self).setUp() | 1456 | super().setUp() |
2739 | 1458 | self.publisher = SoyuzTestPublisher() | 1457 | self.publisher = SoyuzTestPublisher() |
2740 | 1459 | self.publisher.prepareBreezyAutotest() | 1458 | self.publisher.prepareBreezyAutotest() |
2741 | 1460 | 1459 | ||
2742 | @@ -1549,7 +1548,7 @@ class TestGetBinaryPackageReleaseByFileName(TestCaseWithFactory): | |||
2743 | 1549 | 1548 | ||
2744 | 1550 | def setUp(self): | 1549 | def setUp(self): |
2745 | 1551 | """Setup an archive with relevant publications.""" | 1550 | """Setup an archive with relevant publications.""" |
2747 | 1552 | super(TestGetBinaryPackageReleaseByFileName, self).setUp() | 1551 | super().setUp() |
2748 | 1553 | self.publisher = SoyuzTestPublisher() | 1552 | self.publisher = SoyuzTestPublisher() |
2749 | 1554 | self.publisher.prepareBreezyAutotest() | 1553 | self.publisher.prepareBreezyAutotest() |
2750 | 1555 | 1554 | ||
2751 | @@ -1730,7 +1729,7 @@ class TestBuildDebugSymbols(TestCaseWithFactory): | |||
2752 | 1730 | layer = DatabaseFunctionalLayer | 1729 | layer = DatabaseFunctionalLayer |
2753 | 1731 | 1730 | ||
2754 | 1732 | def setUp(self): | 1731 | def setUp(self): |
2756 | 1733 | super(TestBuildDebugSymbols, self).setUp() | 1732 | super().setUp() |
2757 | 1734 | self.archive = self.factory.makeArchive() | 1733 | self.archive = self.factory.makeArchive() |
2758 | 1735 | 1734 | ||
2759 | 1736 | def test_build_debug_symbols_is_public(self): | 1735 | def test_build_debug_symbols_is_public(self): |
2760 | @@ -1887,7 +1886,7 @@ class TestFindDepCandidates(TestCaseWithFactory): | |||
2761 | 1887 | layer = LaunchpadZopelessLayer | 1886 | layer = LaunchpadZopelessLayer |
2762 | 1888 | 1887 | ||
2763 | 1889 | def setUp(self): | 1888 | def setUp(self): |
2765 | 1890 | super(TestFindDepCandidates, self).setUp() | 1889 | super().setUp() |
2766 | 1891 | self.archive = self.factory.makeArchive() | 1890 | self.archive = self.factory.makeArchive() |
2767 | 1892 | self.publisher = SoyuzTestPublisher() | 1891 | self.publisher = SoyuzTestPublisher() |
2768 | 1893 | login('admin@canonical.com') | 1892 | login('admin@canonical.com') |
2769 | @@ -2052,12 +2051,12 @@ class TestOverlays(TestCaseWithFactory): | |||
2770 | 2052 | overlay=True, arch_tag='i386', | 2051 | overlay=True, arch_tag='i386', |
2771 | 2053 | publish_base_url='http://archive.launchpad.test/'): | 2052 | publish_base_url='http://archive.launchpad.test/'): |
2772 | 2054 | # Helper to create a parent/child relationship. | 2053 | # Helper to create a parent/child relationship. |
2774 | 2055 | if isinstance(parent_distro, six.string_types): | 2054 | if isinstance(parent_distro, str): |
2775 | 2056 | depdistro = self.factory.makeDistribution(parent_distro, | 2055 | depdistro = self.factory.makeDistribution(parent_distro, |
2776 | 2057 | publish_base_url=publish_base_url) | 2056 | publish_base_url=publish_base_url) |
2777 | 2058 | else: | 2057 | else: |
2778 | 2059 | depdistro = parent_distro | 2058 | depdistro = parent_distro |
2780 | 2060 | if isinstance(parent_series, six.string_types): | 2059 | if isinstance(parent_series, str): |
2781 | 2061 | depseries = self.factory.makeDistroSeries( | 2060 | depseries = self.factory.makeDistroSeries( |
2782 | 2062 | name=parent_series, distribution=depdistro) | 2061 | name=parent_series, distribution=depdistro) |
2783 | 2063 | self.factory.makeDistroArchSeries( | 2062 | self.factory.makeDistroArchSeries( |
2784 | @@ -2195,7 +2194,7 @@ class TestValidatePPA(TestCaseWithFactory): | |||
2785 | 2195 | layer = DatabaseFunctionalLayer | 2194 | layer = DatabaseFunctionalLayer |
2786 | 2196 | 2195 | ||
2787 | 2197 | def setUp(self): | 2196 | def setUp(self): |
2789 | 2198 | super(TestValidatePPA, self).setUp() | 2197 | super().setUp() |
2790 | 2199 | self.ubuntu = getUtility(IDistributionSet)['ubuntu'] | 2198 | self.ubuntu = getUtility(IDistributionSet)['ubuntu'] |
2791 | 2200 | self.ubuntutest = getUtility(IDistributionSet)['ubuntutest'] | 2199 | self.ubuntutest = getUtility(IDistributionSet)['ubuntutest'] |
2792 | 2201 | with admin_logged_in(): | 2200 | with admin_logged_in(): |
2793 | @@ -2324,7 +2323,7 @@ class TestGetComponentsForSeries(TestCaseWithFactory): | |||
2794 | 2324 | layer = DatabaseFunctionalLayer | 2323 | layer = DatabaseFunctionalLayer |
2795 | 2325 | 2324 | ||
2796 | 2326 | def setUp(self): | 2325 | def setUp(self): |
2798 | 2327 | super(TestGetComponentsForSeries, self).setUp() | 2326 | super().setUp() |
2799 | 2328 | self.series = self.factory.makeDistroSeries() | 2327 | self.series = self.factory.makeDistroSeries() |
2800 | 2329 | self.comp1 = self.factory.makeComponent() | 2328 | self.comp1 = self.factory.makeComponent() |
2801 | 2330 | self.comp2 = self.factory.makeComponent() | 2329 | self.comp2 = self.factory.makeComponent() |
2802 | @@ -2401,7 +2400,7 @@ class TestGetFileByName(TestCaseWithFactory): | |||
2803 | 2401 | layer = LaunchpadZopelessLayer | 2400 | layer = LaunchpadZopelessLayer |
2804 | 2402 | 2401 | ||
2805 | 2403 | def setUp(self): | 2402 | def setUp(self): |
2807 | 2404 | super(TestGetFileByName, self).setUp() | 2403 | super().setUp() |
2808 | 2405 | self.archive = self.factory.makeArchive() | 2404 | self.archive = self.factory.makeArchive() |
2809 | 2406 | 2405 | ||
2810 | 2407 | def test_unknown_file_is_not_found(self): | 2406 | def test_unknown_file_is_not_found(self): |
2811 | @@ -2510,7 +2509,7 @@ class TestGetSourceFileByName(TestCaseWithFactory): | |||
2812 | 2510 | layer = LaunchpadZopelessLayer | 2509 | layer = LaunchpadZopelessLayer |
2813 | 2511 | 2510 | ||
2814 | 2512 | def setUp(self): | 2511 | def setUp(self): |
2816 | 2513 | super(TestGetSourceFileByName, self).setUp() | 2512 | super().setUp() |
2817 | 2514 | self.archive = self.factory.makeArchive() | 2513 | self.archive = self.factory.makeArchive() |
2818 | 2515 | 2514 | ||
2819 | 2516 | def test_source_file_is_found(self): | 2515 | def test_source_file_is_found(self): |
2820 | @@ -3701,7 +3700,7 @@ class TestGetPPAOwnedByPerson(TestCaseWithFactory): | |||
2821 | 3701 | layer = DatabaseFunctionalLayer | 3700 | layer = DatabaseFunctionalLayer |
2822 | 3702 | 3701 | ||
2823 | 3703 | def setUp(self): | 3702 | def setUp(self): |
2825 | 3704 | super(TestGetPPAOwnedByPerson, self).setUp() | 3703 | super().setUp() |
2826 | 3705 | self.set = getUtility(IArchiveSet) | 3704 | self.set = getUtility(IArchiveSet) |
2827 | 3706 | 3705 | ||
2828 | 3707 | def test_person(self): | 3706 | def test_person(self): |
2829 | @@ -3758,7 +3757,7 @@ class TestPPALookup(TestCaseWithFactory): | |||
2830 | 3758 | layer = DatabaseFunctionalLayer | 3757 | layer = DatabaseFunctionalLayer |
2831 | 3759 | 3758 | ||
2832 | 3760 | def setUp(self): | 3759 | def setUp(self): |
2834 | 3761 | super(TestPPALookup, self).setUp() | 3760 | super().setUp() |
2835 | 3762 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 3761 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
2836 | 3763 | self.notbuntu = self.factory.makeDistribution() | 3762 | self.notbuntu = self.factory.makeDistribution() |
2837 | 3764 | self.person = self.factory.makePerson() | 3763 | self.person = self.factory.makePerson() |
2838 | @@ -3847,7 +3846,7 @@ class TestArchiveSetGetByReference(TestCaseWithFactory): | |||
2839 | 3847 | layer = DatabaseFunctionalLayer | 3846 | layer = DatabaseFunctionalLayer |
2840 | 3848 | 3847 | ||
2841 | 3849 | def setUp(self): | 3848 | def setUp(self): |
2843 | 3850 | super(TestArchiveSetGetByReference, self).setUp() | 3849 | super().setUp() |
2844 | 3851 | self.set = getUtility(IArchiveSet) | 3850 | self.set = getUtility(IArchiveSet) |
2845 | 3852 | 3851 | ||
2846 | 3853 | def test_ppa(self): | 3852 | def test_ppa(self): |
2847 | @@ -4206,7 +4205,7 @@ class TestArchiveGetOverridePolicy(TestCaseWithFactory): | |||
2848 | 4206 | layer = DatabaseFunctionalLayer | 4205 | layer = DatabaseFunctionalLayer |
2849 | 4207 | 4206 | ||
2850 | 4208 | def setUp(self): | 4207 | def setUp(self): |
2852 | 4209 | super(TestArchiveGetOverridePolicy, self).setUp() | 4208 | super().setUp() |
2853 | 4210 | self.series = self.factory.makeDistroSeries() | 4209 | self.series = self.factory.makeDistroSeries() |
2854 | 4211 | with admin_logged_in(): | 4210 | with admin_logged_in(): |
2855 | 4212 | self.series.nominatedarchindep = self.amd64 = ( | 4211 | self.series.nominatedarchindep = self.amd64 = ( |
2856 | diff --git a/lib/lp/soyuz/tests/test_archive_subscriptions.py b/lib/lp/soyuz/tests/test_archive_subscriptions.py | |||
2857 | index 04fa7bb..516fcd7 100644 | |||
2858 | --- a/lib/lp/soyuz/tests/test_archive_subscriptions.py | |||
2859 | +++ b/lib/lp/soyuz/tests/test_archive_subscriptions.py | |||
2860 | @@ -44,7 +44,7 @@ class TestArchiveSubscriptions(TestCaseWithFactory): | |||
2861 | 44 | 44 | ||
2862 | 45 | def setUp(self): | 45 | def setUp(self): |
2863 | 46 | """Create a test archive.""" | 46 | """Create a test archive.""" |
2865 | 47 | super(TestArchiveSubscriptions, self).setUp() | 47 | super().setUp() |
2866 | 48 | self.owner = self.factory.makePerson() | 48 | self.owner = self.factory.makePerson() |
2867 | 49 | self.private_team = self.factory.makeTeam( | 49 | self.private_team = self.factory.makeTeam( |
2868 | 50 | visibility=PersonVisibility.PRIVATE, | 50 | visibility=PersonVisibility.PRIVATE, |
2869 | @@ -136,7 +136,7 @@ class PrivateArtifactsViewTestCase(BrowserTestCase): | |||
2870 | 136 | 136 | ||
2871 | 137 | def setUp(self): | 137 | def setUp(self): |
2872 | 138 | """Create a test archive.""" | 138 | """Create a test archive.""" |
2874 | 139 | super(PrivateArtifactsViewTestCase, self).setUp() | 139 | super().setUp() |
2875 | 140 | self.owner = self.factory.makePerson() | 140 | self.owner = self.factory.makePerson() |
2876 | 141 | self.private_team = self.factory.makeTeam( | 141 | self.private_team = self.factory.makeTeam( |
2877 | 142 | visibility=PersonVisibility.PRIVATE, | 142 | visibility=PersonVisibility.PRIVATE, |
2878 | diff --git a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py | |||
2879 | index ccec886..7fbccb3 100644 | |||
2880 | --- a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py | |||
2881 | +++ b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py | |||
2882 | @@ -18,7 +18,7 @@ class TestBinaryAndSourcePackageNameVocabulary(TestCaseWithFactory): | |||
2883 | 18 | layer = DatabaseFunctionalLayer | 18 | layer = DatabaseFunctionalLayer |
2884 | 19 | 19 | ||
2885 | 20 | def setUp(self): | 20 | def setUp(self): |
2887 | 21 | super(TestBinaryAndSourcePackageNameVocabulary, self).setUp() | 21 | super().setUp() |
2888 | 22 | self.vocabulary = BinaryAndSourcePackageNameVocabulary() | 22 | self.vocabulary = BinaryAndSourcePackageNameVocabulary() |
2889 | 23 | spn = self.factory.makeSourcePackageName(name='bedbugs') | 23 | spn = self.factory.makeSourcePackageName(name='bedbugs') |
2890 | 24 | self.bspn = Store.of(spn).find( | 24 | self.bspn = Store.of(spn).find( |
2891 | diff --git a/lib/lp/soyuz/tests/test_binarypackagebuild.py b/lib/lp/soyuz/tests/test_binarypackagebuild.py | |||
2892 | index 3a3f21a..9bfbb41 100644 | |||
2893 | --- a/lib/lp/soyuz/tests/test_binarypackagebuild.py | |||
2894 | +++ b/lib/lp/soyuz/tests/test_binarypackagebuild.py | |||
2895 | @@ -77,7 +77,7 @@ class TestBinaryPackageBuild(TestCaseWithFactory): | |||
2896 | 77 | layer = LaunchpadZopelessLayer | 77 | layer = LaunchpadZopelessLayer |
2897 | 78 | 78 | ||
2898 | 79 | def setUp(self): | 79 | def setUp(self): |
2900 | 80 | super(TestBinaryPackageBuild, self).setUp() | 80 | super().setUp() |
2901 | 81 | self.build = self.factory.makeBinaryPackageBuild( | 81 | self.build = self.factory.makeBinaryPackageBuild( |
2902 | 82 | archive=self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)) | 82 | archive=self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)) |
2903 | 83 | 83 | ||
2904 | @@ -404,7 +404,7 @@ class BaseTestCaseWithThreeBuilds(TestCaseWithFactory): | |||
2905 | 404 | 404 | ||
2906 | 405 | def setUp(self): | 405 | def setUp(self): |
2907 | 406 | """Publish some builds for the test archive.""" | 406 | """Publish some builds for the test archive.""" |
2909 | 407 | super(BaseTestCaseWithThreeBuilds, self).setUp() | 407 | super().setUp() |
2910 | 408 | self.ds = self.factory.makeDistroSeries() | 408 | self.ds = self.factory.makeDistroSeries() |
2911 | 409 | i386_das = self.factory.makeDistroArchSeries( | 409 | i386_das = self.factory.makeDistroArchSeries( |
2912 | 410 | distroseries=self.ds, architecturetag='i386') | 410 | distroseries=self.ds, architecturetag='i386') |
2913 | @@ -457,7 +457,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds): | |||
2914 | 457 | 457 | ||
2915 | 458 | def setUp(self): | 458 | def setUp(self): |
2916 | 459 | """Publish some builds for the test archive.""" | 459 | """Publish some builds for the test archive.""" |
2918 | 460 | super(TestBuildSetGetBuildsForArchive, self).setUp() | 460 | super().setUp() |
2919 | 461 | 461 | ||
2920 | 462 | # Short-cuts for our tests. | 462 | # Short-cuts for our tests. |
2921 | 463 | self.archive = self.ds.main_archive | 463 | self.archive = self.ds.main_archive |
2922 | @@ -479,7 +479,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds): | |||
2923 | 479 | class TestBuildSetGetBuildsForBuilder(BaseTestCaseWithThreeBuilds): | 479 | class TestBuildSetGetBuildsForBuilder(BaseTestCaseWithThreeBuilds): |
2924 | 480 | 480 | ||
2925 | 481 | def setUp(self): | 481 | def setUp(self): |
2927 | 482 | super(TestBuildSetGetBuildsForBuilder, self).setUp() | 482 | super().setUp() |
2928 | 483 | 483 | ||
2929 | 484 | # Short-cuts for our tests. | 484 | # Short-cuts for our tests. |
2930 | 485 | self.build_set = getUtility(IBinaryPackageBuildSet) | 485 | self.build_set = getUtility(IBinaryPackageBuildSet) |
2931 | @@ -524,7 +524,7 @@ class TestBinaryPackageBuildWebservice(TestCaseWithFactory): | |||
2932 | 524 | layer = DatabaseFunctionalLayer | 524 | layer = DatabaseFunctionalLayer |
2933 | 525 | 525 | ||
2934 | 526 | def setUp(self): | 526 | def setUp(self): |
2936 | 527 | super(TestBinaryPackageBuildWebservice, self).setUp() | 527 | super().setUp() |
2937 | 528 | self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA) | 528 | self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA) |
2938 | 529 | self.build = self.factory.makeBinaryPackageBuild(archive=self.ppa) | 529 | self.build = self.factory.makeBinaryPackageBuild(archive=self.ppa) |
2939 | 530 | self.webservice = webservice_for_person( | 530 | self.webservice = webservice_for_person( |
2940 | @@ -929,7 +929,7 @@ class TestBinaryPackageBuildMacaroonIssuer( | |||
2941 | 929 | layer = LaunchpadZopelessLayer | 929 | layer = LaunchpadZopelessLayer |
2942 | 930 | 930 | ||
2943 | 931 | def setUp(self): | 931 | def setUp(self): |
2945 | 932 | super(TestBinaryPackageBuildMacaroonIssuer, self).setUp() | 932 | super().setUp() |
2946 | 933 | self.pushConfig( | 933 | self.pushConfig( |
2947 | 934 | "launchpad", internal_macaroon_secret_key="some-secret") | 934 | "launchpad", internal_macaroon_secret_key="some-secret") |
2948 | 935 | 935 | ||
2949 | diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
2950 | index 5239946..4f06427 100644 | |||
2951 | --- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
2952 | +++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
2953 | @@ -94,7 +94,7 @@ class TestBinaryBuildPackageBehaviour(StatsMixin, TestCaseWithFactory): | |||
2954 | 94 | timeout=30) | 94 | timeout=30) |
2955 | 95 | 95 | ||
2956 | 96 | def setUp(self): | 96 | def setUp(self): |
2958 | 97 | super(TestBinaryBuildPackageBehaviour, self).setUp() | 97 | super().setUp() |
2959 | 98 | switch_dbuser('testadmin') | 98 | switch_dbuser('testadmin') |
2960 | 99 | self.setUpStats() | 99 | self.setUpStats() |
2961 | 100 | 100 | ||
2962 | @@ -534,7 +534,7 @@ class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory): | |||
2963 | 534 | shutil.rmtree(config.builddmaster.root) | 534 | shutil.rmtree(config.builddmaster.root) |
2964 | 535 | 535 | ||
2965 | 536 | def setUp(self): | 536 | def setUp(self): |
2967 | 537 | super(TestBinaryBuildPackageBehaviourBuildCollection, self).setUp() | 537 | super().setUp() |
2968 | 538 | switch_dbuser('testadmin') | 538 | switch_dbuser('testadmin') |
2969 | 539 | 539 | ||
2970 | 540 | self.builder = self.factory.makeBuilder() | 540 | self.builder = self.factory.makeBuilder() |
2971 | diff --git a/lib/lp/soyuz/tests/test_binarypackagename.py b/lib/lp/soyuz/tests/test_binarypackagename.py | |||
2972 | index 9137864..e9564ee 100644 | |||
2973 | --- a/lib/lp/soyuz/tests/test_binarypackagename.py | |||
2974 | +++ b/lib/lp/soyuz/tests/test_binarypackagename.py | |||
2975 | @@ -17,7 +17,7 @@ class TestBinaryPackageNameSet(TestCaseWithFactory): | |||
2976 | 17 | layer = DatabaseFunctionalLayer | 17 | layer = DatabaseFunctionalLayer |
2977 | 18 | 18 | ||
2978 | 19 | def setUp(self): | 19 | def setUp(self): |
2980 | 20 | super(TestBinaryPackageNameSet, self).setUp() | 20 | super().setUp() |
2981 | 21 | self.name_set = getUtility(IBinaryPackageNameSet) | 21 | self.name_set = getUtility(IBinaryPackageNameSet) |
2982 | 22 | 22 | ||
2983 | 23 | def test___getitem__found(self): | 23 | def test___getitem__found(self): |
2984 | diff --git a/lib/lp/soyuz/tests/test_binarysourcereference.py b/lib/lp/soyuz/tests/test_binarysourcereference.py | |||
2985 | index ddb05f8..944c35b 100644 | |||
2986 | --- a/lib/lp/soyuz/tests/test_binarysourcereference.py | |||
2987 | +++ b/lib/lp/soyuz/tests/test_binarysourcereference.py | |||
2988 | @@ -30,7 +30,7 @@ class TestBinarySourceReference(TestCaseWithFactory): | |||
2989 | 30 | layer = DatabaseFunctionalLayer | 30 | layer = DatabaseFunctionalLayer |
2990 | 31 | 31 | ||
2991 | 32 | def setUp(self): | 32 | def setUp(self): |
2993 | 33 | super(TestBinarySourceReference, self).setUp() | 33 | super().setUp() |
2994 | 34 | self.reference_set = getUtility(IBinarySourceReferenceSet) | 34 | self.reference_set = getUtility(IBinarySourceReferenceSet) |
2995 | 35 | 35 | ||
2996 | 36 | def test_createFromRelationship_empty(self): | 36 | def test_createFromRelationship_empty(self): |
2997 | diff --git a/lib/lp/soyuz/tests/test_build.py b/lib/lp/soyuz/tests/test_build.py | |||
2998 | index 8181a2d..36bb5a3 100644 | |||
2999 | --- a/lib/lp/soyuz/tests/test_build.py | |||
3000 | +++ b/lib/lp/soyuz/tests/test_build.py | |||
3001 | @@ -38,7 +38,7 @@ class TestBuild(TestCaseWithFactory): | |||
3002 | 38 | layer = LaunchpadFunctionalLayer | 38 | layer = LaunchpadFunctionalLayer |
3003 | 39 | 39 | ||
3004 | 40 | def setUp(self): | 40 | def setUp(self): |
3006 | 41 | super(TestBuild, self).setUp() | 41 | super().setUp() |
3007 | 42 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 42 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3008 | 43 | self.processor = self.factory.makeProcessor(supports_virtualized=True) | 43 | self.processor = self.factory.makeProcessor(supports_virtualized=True) |
3009 | 44 | self.distroseries = self.factory.makeDistroSeries() | 44 | self.distroseries = self.factory.makeDistroSeries() |
3010 | diff --git a/lib/lp/soyuz/tests/test_build_depwait.py b/lib/lp/soyuz/tests/test_build_depwait.py | |||
3011 | index dd57b39..f4d9567 100644 | |||
3012 | --- a/lib/lp/soyuz/tests/test_build_depwait.py | |||
3013 | +++ b/lib/lp/soyuz/tests/test_build_depwait.py | |||
3014 | @@ -25,7 +25,7 @@ class TestBuildDepWait(TestCaseWithFactory): | |||
3015 | 25 | layer = LaunchpadFunctionalLayer | 25 | layer = LaunchpadFunctionalLayer |
3016 | 26 | 26 | ||
3017 | 27 | def setUp(self): | 27 | def setUp(self): |
3019 | 28 | super(TestBuildDepWait, self).setUp() | 28 | super().setUp() |
3020 | 29 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 29 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3021 | 30 | # Create everything we need to create builds, such as a | 30 | # Create everything we need to create builds, such as a |
3022 | 31 | # DistroArchSeries and a builder. | 31 | # DistroArchSeries and a builder. |
3023 | diff --git a/lib/lp/soyuz/tests/test_build_notify.py b/lib/lp/soyuz/tests/test_build_notify.py | |||
3024 | index 3621091..fa90f02 100644 | |||
3025 | --- a/lib/lp/soyuz/tests/test_build_notify.py | |||
3026 | +++ b/lib/lp/soyuz/tests/test_build_notify.py | |||
3027 | @@ -46,7 +46,7 @@ class TestBuildNotify(TestCaseWithFactory): | |||
3028 | 46 | layer = LaunchpadZopelessLayer | 46 | layer = LaunchpadZopelessLayer |
3029 | 47 | 47 | ||
3030 | 48 | def setUp(self): | 48 | def setUp(self): |
3032 | 49 | super(TestBuildNotify, self).setUp() | 49 | super().setUp() |
3033 | 50 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 50 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3034 | 51 | # Create all of the items we need to create builds | 51 | # Create all of the items we need to create builds |
3035 | 52 | self.processor = self.factory.makeProcessor(supports_virtualized=True) | 52 | self.processor = self.factory.makeProcessor(supports_virtualized=True) |
3036 | diff --git a/lib/lp/soyuz/tests/test_build_privacy.py b/lib/lp/soyuz/tests/test_build_privacy.py | |||
3037 | index 3004a0d..85ebaaf 100644 | |||
3038 | --- a/lib/lp/soyuz/tests/test_build_privacy.py | |||
3039 | +++ b/lib/lp/soyuz/tests/test_build_privacy.py | |||
3040 | @@ -20,7 +20,7 @@ class TestBuildPrivacy(TestCaseWithFactory): | |||
3041 | 20 | layer = LaunchpadFunctionalLayer | 20 | layer = LaunchpadFunctionalLayer |
3042 | 21 | 21 | ||
3043 | 22 | def setUp(self): | 22 | def setUp(self): |
3045 | 23 | super(TestBuildPrivacy, self).setUp() | 23 | super().setUp() |
3046 | 24 | # Add everything we need to create builds. | 24 | # Add everything we need to create builds. |
3047 | 25 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 25 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3048 | 26 | processor = self.factory.makeProcessor(supports_virtualized=True) | 26 | processor = self.factory.makeProcessor(supports_virtualized=True) |
3049 | diff --git a/lib/lp/soyuz/tests/test_build_set.py b/lib/lp/soyuz/tests/test_build_set.py | |||
3050 | index 84f57eb..6dcf9fd 100644 | |||
3051 | --- a/lib/lp/soyuz/tests/test_build_set.py | |||
3052 | +++ b/lib/lp/soyuz/tests/test_build_set.py | |||
3053 | @@ -42,7 +42,7 @@ class TestBuildSet(TestCaseWithFactory): | |||
3054 | 42 | layer = LaunchpadFunctionalLayer | 42 | layer = LaunchpadFunctionalLayer |
3055 | 43 | 43 | ||
3056 | 44 | def setUp(self): | 44 | def setUp(self): |
3058 | 45 | super(TestBuildSet, self).setUp() | 45 | super().setUp() |
3059 | 46 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 46 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3060 | 47 | self.processor_one = self.factory.makeProcessor( | 47 | self.processor_one = self.factory.makeProcessor( |
3061 | 48 | supports_virtualized=True) | 48 | supports_virtualized=True) |
3062 | @@ -269,7 +269,7 @@ class TestGetAllowedArchitectures(TestCaseWithFactory): | |||
3063 | 269 | layer = ZopelessDatabaseLayer | 269 | layer = ZopelessDatabaseLayer |
3064 | 270 | 270 | ||
3065 | 271 | def setUp(self): | 271 | def setUp(self): |
3067 | 272 | super(TestGetAllowedArchitectures, self).setUp() | 272 | super().setUp() |
3068 | 273 | self.avr = self.factory.makeProcessor( | 273 | self.avr = self.factory.makeProcessor( |
3069 | 274 | name="avr2001", supports_virtualized=True) | 274 | name="avr2001", supports_virtualized=True) |
3070 | 275 | self.sparc = self.factory.makeProcessor( | 275 | self.sparc = self.factory.makeProcessor( |
3071 | @@ -347,7 +347,7 @@ class BuildRecordCreationTests(TestNativePublishingBase): | |||
3072 | 347 | """Test the creation of build records.""" | 347 | """Test the creation of build records.""" |
3073 | 348 | 348 | ||
3074 | 349 | def setUp(self): | 349 | def setUp(self): |
3076 | 350 | super(BuildRecordCreationTests, self).setUp() | 350 | super().setUp() |
3077 | 351 | self.distro = self.factory.makeDistribution() | 351 | self.distro = self.factory.makeDistribution() |
3078 | 352 | self.avr = self.factory.makeProcessor( | 352 | self.avr = self.factory.makeProcessor( |
3079 | 353 | name="avr2001", supports_virtualized=True) | 353 | name="avr2001", supports_virtualized=True) |
3080 | @@ -386,7 +386,7 @@ class BuildRecordCreationTests(TestNativePublishingBase): | |||
3081 | 386 | :param architecturehintlist: Architecture hint list | 386 | :param architecturehintlist: Architecture hint list |
3082 | 387 | (e.g. "i386 amd64") | 387 | (e.g. "i386 amd64") |
3083 | 388 | """ | 388 | """ |
3085 | 389 | return super(BuildRecordCreationTests, self).getPubSource( | 389 | return super().getPubSource( |
3086 | 390 | archive=self.factory.makeArchive(), distroseries=self.distroseries, | 390 | archive=self.factory.makeArchive(), distroseries=self.distroseries, |
3087 | 391 | architecturehintlist=architecturehintlist) | 391 | architecturehintlist=architecturehintlist) |
3088 | 392 | 392 | ||
3089 | @@ -588,7 +588,7 @@ class TestFindBuiltOrPublishedBySourceAndArchive(TestCaseWithFactory): | |||
3090 | 588 | layer = ZopelessDatabaseLayer | 588 | layer = ZopelessDatabaseLayer |
3091 | 589 | 589 | ||
3092 | 590 | def setUp(self): | 590 | def setUp(self): |
3094 | 591 | super(TestFindBuiltOrPublishedBySourceAndArchive, self).setUp() | 591 | super().setUp() |
3095 | 592 | self.bpbs = getUtility(IBinaryPackageBuildSet) | 592 | self.bpbs = getUtility(IBinaryPackageBuildSet) |
3096 | 593 | 593 | ||
3097 | 594 | def test_trivial(self): | 594 | def test_trivial(self): |
3098 | diff --git a/lib/lp/soyuz/tests/test_build_start_estimation.py b/lib/lp/soyuz/tests/test_build_start_estimation.py | |||
3099 | index b26dae1..07f625e 100644 | |||
3100 | --- a/lib/lp/soyuz/tests/test_build_start_estimation.py | |||
3101 | +++ b/lib/lp/soyuz/tests/test_build_start_estimation.py | |||
3102 | @@ -29,7 +29,7 @@ class TestBuildStartEstimation(TestCaseWithFactory): | |||
3103 | 29 | layer = LaunchpadFunctionalLayer | 29 | layer = LaunchpadFunctionalLayer |
3104 | 30 | 30 | ||
3105 | 31 | def setUp(self): | 31 | def setUp(self): |
3107 | 32 | super(TestBuildStartEstimation, self).setUp() | 32 | super().setUp() |
3108 | 33 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 33 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3109 | 34 | with person_logged_in(self.admin): | 34 | with person_logged_in(self.admin): |
3110 | 35 | self.publisher = SoyuzTestPublisher() | 35 | self.publisher = SoyuzTestPublisher() |
3111 | diff --git a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py | |||
3112 | index 5abdd67..38dcc3e 100644 | |||
3113 | --- a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py | |||
3114 | +++ b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py | |||
3115 | @@ -29,7 +29,7 @@ class TestDistributionSourcePackageRelease(TestCaseWithFactory): | |||
3116 | 29 | layer = DatabaseFunctionalLayer | 29 | layer = DatabaseFunctionalLayer |
3117 | 30 | 30 | ||
3118 | 31 | def setUp(self): | 31 | def setUp(self): |
3120 | 32 | super(TestDistributionSourcePackageRelease, self).setUp() | 32 | super().setUp() |
3121 | 33 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() | 33 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() |
3122 | 34 | self.distroarchseries = self.factory.makeDistroArchSeries( | 34 | self.distroarchseries = self.factory.makeDistroArchSeries( |
3123 | 35 | distroseries=self.sourcepackagerelease.upload_distroseries) | 35 | distroseries=self.sourcepackagerelease.upload_distroseries) |
3124 | @@ -159,7 +159,7 @@ class TestGetBinariesForSeries(TestCaseWithFactory): | |||
3125 | 159 | layer = DatabaseFunctionalLayer | 159 | layer = DatabaseFunctionalLayer |
3126 | 160 | 160 | ||
3127 | 161 | def setUp(self): | 161 | def setUp(self): |
3129 | 162 | super(TestGetBinariesForSeries, self).setUp() | 162 | super().setUp() |
3130 | 163 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() | 163 | self.sourcepackagerelease = self.factory.makeSourcePackageRelease() |
3131 | 164 | self.distroarchseries = self.factory.makeDistroArchSeries( | 164 | self.distroarchseries = self.factory.makeDistroArchSeries( |
3132 | 165 | distroseries=self.sourcepackagerelease.upload_distroseries) | 165 | distroseries=self.sourcepackagerelease.upload_distroseries) |
3133 | diff --git a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py | |||
3134 | index 2b61058..682d7db 100644 | |||
3135 | --- a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py | |||
3136 | +++ b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py | |||
3137 | @@ -32,7 +32,7 @@ class TestDistroSeriesBinaryPackage(TestCaseWithFactory): | |||
3138 | 32 | 32 | ||
3139 | 33 | def setUp(self): | 33 | def setUp(self): |
3140 | 34 | """Create a distroseriesbinarypackage to play with.""" | 34 | """Create a distroseriesbinarypackage to play with.""" |
3142 | 35 | super(TestDistroSeriesBinaryPackage, self).setUp() | 35 | super().setUp() |
3143 | 36 | self.publisher = SoyuzTestPublisher() | 36 | self.publisher = SoyuzTestPublisher() |
3144 | 37 | self.publisher.prepareBreezyAutotest() | 37 | self.publisher.prepareBreezyAutotest() |
3145 | 38 | self.distroseries = self.publisher.distroseries | 38 | self.distroseries = self.publisher.distroseries |
3146 | diff --git a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py | |||
3147 | index e9f007d..220fc9f 100644 | |||
3148 | --- a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py | |||
3149 | +++ b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py | |||
3150 | @@ -607,7 +607,7 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory): | |||
3151 | 607 | layer = LaunchpadZopelessLayer | 607 | layer = LaunchpadZopelessLayer |
3152 | 608 | 608 | ||
3153 | 609 | def setUp(self): | 609 | def setUp(self): |
3155 | 610 | super(TestDistroSeriesDifferenceJobEndToEnd, self).setUp() | 610 | super().setUp() |
3156 | 611 | self.store = IMasterStore(DistroSeriesDifference) | 611 | self.store = IMasterStore(DistroSeriesDifference) |
3157 | 612 | 612 | ||
3158 | 613 | def getJobSource(self): | 613 | def getJobSource(self): |
3159 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py | |||
3160 | index 5c41eac..3f1c664 100644 | |||
3161 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py | |||
3162 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py | |||
3163 | @@ -34,7 +34,7 @@ from lp.testing.gpgkeys import import_public_test_keys | |||
3164 | 34 | class TestDistroSeriesQueueDdtpTarball(TestNativePublishingBase): | 34 | class TestDistroSeriesQueueDdtpTarball(TestNativePublishingBase): |
3165 | 35 | 35 | ||
3166 | 36 | def setUp(self): | 36 | def setUp(self): |
3168 | 37 | super(TestDistroSeriesQueueDdtpTarball, self).setUp() | 37 | super().setUp() |
3169 | 38 | import_public_test_keys() | 38 | import_public_test_keys() |
3170 | 39 | # CustomUpload.installFiles requires a umask of 0o022. | 39 | # CustomUpload.installFiles requires a umask of 0o022. |
3171 | 40 | old_umask = os.umask(0o022) | 40 | old_umask = os.umask(0o022) |
3172 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py | |||
3173 | index 326be48..3338d1a 100644 | |||
3174 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py | |||
3175 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py | |||
3176 | @@ -27,7 +27,7 @@ from lp.testing.gpgkeys import import_public_test_keys | |||
3177 | 27 | class TestDistroSeriesQueueDebianInstaller(TestNativePublishingBase): | 27 | class TestDistroSeriesQueueDebianInstaller(TestNativePublishingBase): |
3178 | 28 | 28 | ||
3179 | 29 | def setUp(self): | 29 | def setUp(self): |
3181 | 30 | super(TestDistroSeriesQueueDebianInstaller, self).setUp() | 30 | super().setUp() |
3182 | 31 | import_public_test_keys() | 31 | import_public_test_keys() |
3183 | 32 | # CustomUpload.installFiles requires a umask of 0o022. | 32 | # CustomUpload.installFiles requires a umask of 0o022. |
3184 | 33 | old_umask = os.umask(0o022) | 33 | old_umask = os.umask(0o022) |
3185 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py | |||
3186 | index 6dac873..8620c42 100644 | |||
3187 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py | |||
3188 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py | |||
3189 | @@ -30,7 +30,7 @@ from lp.testing.gpgkeys import import_public_test_keys | |||
3190 | 30 | class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase): | 30 | class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase): |
3191 | 31 | 31 | ||
3192 | 32 | def setUp(self): | 32 | def setUp(self): |
3194 | 33 | super(TestDistroSeriesQueueDistUpgrader, self).setUp() | 33 | super().setUp() |
3195 | 34 | import_public_test_keys() | 34 | import_public_test_keys() |
3196 | 35 | # CustomUpload.installFiles requires a umask of 0o022. | 35 | # CustomUpload.installFiles requires a umask of 0o022. |
3197 | 36 | old_umask = os.umask(0o022) | 36 | old_umask = os.umask(0o022) |
3198 | @@ -42,7 +42,7 @@ class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase): | |||
3199 | 42 | self.logger = DevNullLogger() | 42 | self.logger = DevNullLogger() |
3200 | 43 | 43 | ||
3201 | 44 | def tearDown(self): | 44 | def tearDown(self): |
3203 | 45 | super(TestDistroSeriesQueueDistUpgrader, self).tearDown() | 45 | super().tearDown() |
3204 | 46 | if os.path.exists(config.personalpackagearchive.root): | 46 | if os.path.exists(config.personalpackagearchive.root): |
3205 | 47 | shutil.rmtree(config.personalpackagearchive.root) | 47 | shutil.rmtree(config.personalpackagearchive.root) |
3206 | 48 | 48 | ||
3207 | diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py | |||
3208 | index 7cfcf54..b13658b 100644 | |||
3209 | --- a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py | |||
3210 | +++ b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py | |||
3211 | @@ -51,7 +51,7 @@ class TestDistroSeriesQueueRosettaTranslationsTarball( | |||
3212 | 51 | layer = LaunchpadZopelessLayer | 51 | layer = LaunchpadZopelessLayer |
3213 | 52 | 52 | ||
3214 | 53 | def setUp(self): | 53 | def setUp(self): |
3216 | 54 | super(TestDistroSeriesQueueRosettaTranslationsTarball, self).setUp() | 54 | super().setUp() |
3217 | 55 | import_public_test_keys() | 55 | import_public_test_keys() |
3218 | 56 | self.logger = DevNullLogger() | 56 | self.logger = DevNullLogger() |
3219 | 57 | self.absolutely_anything_policy = getPolicy( | 57 | self.absolutely_anything_policy = getPolicy( |
3220 | diff --git a/lib/lp/soyuz/tests/test_hasbuildrecords.py b/lib/lp/soyuz/tests/test_hasbuildrecords.py | |||
3221 | index 94c146b..bcb15f1 100644 | |||
3222 | --- a/lib/lp/soyuz/tests/test_hasbuildrecords.py | |||
3223 | +++ b/lib/lp/soyuz/tests/test_hasbuildrecords.py | |||
3224 | @@ -45,7 +45,7 @@ class TestHasBuildRecordsInterface(BaseTestCaseWithThreeBuilds): | |||
3225 | 45 | 45 | ||
3226 | 46 | def setUp(self): | 46 | def setUp(self): |
3227 | 47 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" | 47 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" |
3229 | 48 | super(TestHasBuildRecordsInterface, self).setUp() | 48 | super().setUp() |
3230 | 49 | self.context = self.ds.distribution | 49 | self.context = self.ds.distribution |
3231 | 50 | 50 | ||
3232 | 51 | def testProvidesHasBuildRecords(self): | 51 | def testProvidesHasBuildRecords(self): |
3233 | @@ -73,7 +73,7 @@ class TestDistributionHasBuildRecords(TestCaseWithFactory): | |||
3234 | 73 | layer = LaunchpadZopelessLayer | 73 | layer = LaunchpadZopelessLayer |
3235 | 74 | 74 | ||
3236 | 75 | def setUp(self): | 75 | def setUp(self): |
3238 | 76 | super(TestDistributionHasBuildRecords, self).setUp() | 76 | super().setUp() |
3239 | 77 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) | 77 | self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL) |
3240 | 78 | # Create the machinery we need to create builds, such as | 78 | # Create the machinery we need to create builds, such as |
3241 | 79 | # DistroArchSeries and builders. | 79 | # DistroArchSeries and builders. |
3242 | @@ -127,7 +127,7 @@ class TestDistroSeriesHasBuildRecords(TestHasBuildRecordsInterface): | |||
3243 | 127 | """Test the DistroSeries implementation of IHasBuildRecords.""" | 127 | """Test the DistroSeries implementation of IHasBuildRecords.""" |
3244 | 128 | 128 | ||
3245 | 129 | def setUp(self): | 129 | def setUp(self): |
3247 | 130 | super(TestDistroSeriesHasBuildRecords, self).setUp() | 130 | super().setUp() |
3248 | 131 | self.context = self.ds | 131 | self.context = self.ds |
3249 | 132 | 132 | ||
3250 | 133 | 133 | ||
3251 | @@ -137,7 +137,7 @@ class TestDistroArchSeriesHasBuildRecords(TestDistributionHasBuildRecords): | |||
3252 | 137 | layer = LaunchpadZopelessLayer | 137 | layer = LaunchpadZopelessLayer |
3253 | 138 | 138 | ||
3254 | 139 | def setUp(self): | 139 | def setUp(self): |
3256 | 140 | super(TestDistroArchSeriesHasBuildRecords, self).setUp() | 140 | super().setUp() |
3257 | 141 | 141 | ||
3258 | 142 | def test_distroarchseries(self): | 142 | def test_distroarchseries(self): |
3259 | 143 | # We can fetch builds records from a DistroArchSeries. | 143 | # We can fetch builds records from a DistroArchSeries. |
3260 | @@ -161,7 +161,7 @@ class TestArchiveHasBuildRecords(TestHasBuildRecordsInterface): | |||
3261 | 161 | """Test the Archive implementation of IHasBuildRecords.""" | 161 | """Test the Archive implementation of IHasBuildRecords.""" |
3262 | 162 | 162 | ||
3263 | 163 | def setUp(self): | 163 | def setUp(self): |
3265 | 164 | super(TestArchiveHasBuildRecords, self).setUp() | 164 | super().setUp() |
3266 | 165 | 165 | ||
3267 | 166 | self.context = self.ds.main_archive | 166 | self.context = self.ds.main_archive |
3268 | 167 | 167 | ||
3269 | @@ -191,7 +191,7 @@ class TestBuilderHasBuildRecords(TestHasBuildRecordsInterface): | |||
3270 | 191 | """Test the Builder implementation of IHasBuildRecords.""" | 191 | """Test the Builder implementation of IHasBuildRecords.""" |
3271 | 192 | 192 | ||
3272 | 193 | def setUp(self): | 193 | def setUp(self): |
3274 | 194 | super(TestBuilderHasBuildRecords, self).setUp() | 194 | super().setUp() |
3275 | 195 | 195 | ||
3276 | 196 | # Create a 386 builder | 196 | # Create a 386 builder |
3277 | 197 | self.context = self.factory.makeBuilder() | 197 | self.context = self.factory.makeBuilder() |
3278 | @@ -237,7 +237,7 @@ class TestSourcePackageHasBuildRecords(TestHasBuildRecordsInterface): | |||
3279 | 237 | """Test the SourcePackage implementation of IHasBuildRecords.""" | 237 | """Test the SourcePackage implementation of IHasBuildRecords.""" |
3280 | 238 | 238 | ||
3281 | 239 | def setUp(self): | 239 | def setUp(self): |
3283 | 240 | super(TestSourcePackageHasBuildRecords, self).setUp() | 240 | super().setUp() |
3284 | 241 | gedit_name = self.builds[0].source_package_release.sourcepackagename | 241 | gedit_name = self.builds[0].source_package_release.sourcepackagename |
3285 | 242 | self.context = SourcePackage( | 242 | self.context = SourcePackage( |
3286 | 243 | gedit_name, self.builds[0].distro_arch_series.distroseries) | 243 | gedit_name, self.builds[0].distro_arch_series.distroseries) |
3287 | diff --git a/lib/lp/soyuz/tests/test_livefs.py b/lib/lp/soyuz/tests/test_livefs.py | |||
3288 | index 427ff7d..9ccd18a 100644 | |||
3289 | --- a/lib/lp/soyuz/tests/test_livefs.py | |||
3290 | +++ b/lib/lp/soyuz/tests/test_livefs.py | |||
3291 | @@ -89,7 +89,7 @@ class TestLiveFS(TestCaseWithFactory): | |||
3292 | 89 | layer = DatabaseFunctionalLayer | 89 | layer = DatabaseFunctionalLayer |
3293 | 90 | 90 | ||
3294 | 91 | def setUp(self): | 91 | def setUp(self): |
3296 | 92 | super(TestLiveFS, self).setUp() | 92 | super().setUp() |
3297 | 93 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 93 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3298 | 94 | 94 | ||
3299 | 95 | def test_implements_interfaces(self): | 95 | def test_implements_interfaces(self): |
3300 | @@ -455,7 +455,7 @@ class TestLiveFSSet(TestCaseWithFactory): | |||
3301 | 455 | layer = DatabaseFunctionalLayer | 455 | layer = DatabaseFunctionalLayer |
3302 | 456 | 456 | ||
3303 | 457 | def setUp(self): | 457 | def setUp(self): |
3305 | 458 | super(TestLiveFSSet, self).setUp() | 458 | super().setUp() |
3306 | 459 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 459 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3307 | 460 | 460 | ||
3308 | 461 | def test_class_implements_interfaces(self): | 461 | def test_class_implements_interfaces(self): |
3309 | @@ -550,7 +550,7 @@ class TestLiveFSWebservice(TestCaseWithFactory): | |||
3310 | 550 | layer = DatabaseFunctionalLayer | 550 | layer = DatabaseFunctionalLayer |
3311 | 551 | 551 | ||
3312 | 552 | def setUp(self): | 552 | def setUp(self): |
3314 | 553 | super(TestLiveFSWebservice, self).setUp() | 553 | super().setUp() |
3315 | 554 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 554 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3316 | 555 | self.person = self.factory.makePerson(displayname="Test Person") | 555 | self.person = self.factory.makePerson(displayname="Test Person") |
3317 | 556 | self.webservice = webservice_for_person( | 556 | self.webservice = webservice_for_person( |
3318 | diff --git a/lib/lp/soyuz/tests/test_livefsbuild.py b/lib/lp/soyuz/tests/test_livefsbuild.py | |||
3319 | index 2a64479..d448344 100644 | |||
3320 | --- a/lib/lp/soyuz/tests/test_livefsbuild.py | |||
3321 | +++ b/lib/lp/soyuz/tests/test_livefsbuild.py | |||
3322 | @@ -110,7 +110,7 @@ class TestLiveFSBuild(TestCaseWithFactory): | |||
3323 | 110 | layer = LaunchpadZopelessLayer | 110 | layer = LaunchpadZopelessLayer |
3324 | 111 | 111 | ||
3325 | 112 | def setUp(self): | 112 | def setUp(self): |
3327 | 113 | super(TestLiveFSBuild, self).setUp() | 113 | super().setUp() |
3328 | 114 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 114 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3329 | 115 | self.build = self.factory.makeLiveFSBuild() | 115 | self.build = self.factory.makeLiveFSBuild() |
3330 | 116 | 116 | ||
3331 | @@ -375,7 +375,7 @@ class TestLiveFSBuildSet(TestCaseWithFactory): | |||
3332 | 375 | layer = LaunchpadZopelessLayer | 375 | layer = LaunchpadZopelessLayer |
3333 | 376 | 376 | ||
3334 | 377 | def setUp(self): | 377 | def setUp(self): |
3336 | 378 | super(TestLiveFSBuildSet, self).setUp() | 378 | super().setUp() |
3337 | 379 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 379 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3338 | 380 | 380 | ||
3339 | 381 | def test_getByBuildFarmJob_works(self): | 381 | def test_getByBuildFarmJob_works(self): |
3340 | @@ -407,7 +407,7 @@ class TestLiveFSBuildWebservice(TestCaseWithFactory): | |||
3341 | 407 | layer = LaunchpadFunctionalLayer | 407 | layer = LaunchpadFunctionalLayer |
3342 | 408 | 408 | ||
3343 | 409 | def setUp(self): | 409 | def setUp(self): |
3345 | 410 | super(TestLiveFSBuildWebservice, self).setUp() | 410 | super().setUp() |
3346 | 411 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 411 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3347 | 412 | self.person = self.factory.makePerson() | 412 | self.person = self.factory.makePerson() |
3348 | 413 | self.webservice = webservice_for_person( | 413 | self.webservice = webservice_for_person( |
3349 | @@ -599,7 +599,7 @@ class TestLiveFSBuildMacaroonIssuer(MacaroonTestMixin, TestCaseWithFactory): | |||
3350 | 599 | layer = LaunchpadZopelessLayer | 599 | layer = LaunchpadZopelessLayer |
3351 | 600 | 600 | ||
3352 | 601 | def setUp(self): | 601 | def setUp(self): |
3354 | 602 | super(TestLiveFSBuildMacaroonIssuer, self).setUp() | 602 | super().setUp() |
3355 | 603 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 603 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3356 | 604 | self.pushConfig( | 604 | self.pushConfig( |
3357 | 605 | "launchpad", internal_macaroon_secret_key="some-secret") | 605 | "launchpad", internal_macaroon_secret_key="some-secret") |
3358 | diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
3359 | index 5a9bcc2..0c39013 100644 | |||
3360 | --- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
3361 | +++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
3362 | @@ -65,7 +65,7 @@ class TestLiveFSBuildBehaviourBase(TestCaseWithFactory): | |||
3363 | 65 | layer = LaunchpadZopelessLayer | 65 | layer = LaunchpadZopelessLayer |
3364 | 66 | 66 | ||
3365 | 67 | def setUp(self): | 67 | def setUp(self): |
3367 | 68 | super(TestLiveFSBuildBehaviourBase, self).setUp() | 68 | super().setUp() |
3368 | 69 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) | 69 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"})) |
3369 | 70 | 70 | ||
3370 | 71 | def makeJob(self, archive=None, pocket=PackagePublishingPocket.RELEASE, | 71 | def makeJob(self, archive=None, pocket=PackagePublishingPocket.RELEASE, |
3371 | diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py | |||
3372 | index 50a65c8..97781f1 100644 | |||
3373 | --- a/lib/lp/soyuz/tests/test_packagecopyjob.py | |||
3374 | +++ b/lib/lp/soyuz/tests/test_packagecopyjob.py | |||
3375 | @@ -185,7 +185,7 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper): | |||
3376 | 185 | layer = LaunchpadZopelessLayer | 185 | layer = LaunchpadZopelessLayer |
3377 | 186 | 186 | ||
3378 | 187 | def setUp(self): | 187 | def setUp(self): |
3380 | 188 | super(PlainPackageCopyJobTests, self).setUp() | 188 | super().setUp() |
3381 | 189 | self.publisher = SoyuzTestPublisher() | 189 | self.publisher = SoyuzTestPublisher() |
3382 | 190 | self.publisher.prepareBreezyAutotest() | 190 | self.publisher.prepareBreezyAutotest() |
3383 | 191 | self.distroseries = self.publisher.breezy_autotest | 191 | self.distroseries = self.publisher.breezy_autotest |
3384 | @@ -1803,7 +1803,7 @@ class TestViaCelery(TestCaseWithFactory): | |||
3385 | 1803 | layer = CeleryJobLayer | 1803 | layer = CeleryJobLayer |
3386 | 1804 | 1804 | ||
3387 | 1805 | def setUp(self): | 1805 | def setUp(self): |
3389 | 1806 | super(TestViaCelery, self).setUp() | 1806 | super().setUp() |
3390 | 1807 | # Turn on Celery handling of PCJs and the resulting notification jobs. | 1807 | # Turn on Celery handling of PCJs and the resulting notification jobs. |
3391 | 1808 | self.useFixture(FeatureFixture({ | 1808 | self.useFixture(FeatureFixture({ |
3392 | 1809 | 'jobs.celery.enabled_classes': | 1809 | 'jobs.celery.enabled_classes': |
3393 | @@ -1811,7 +1811,7 @@ class TestViaCelery(TestCaseWithFactory): | |||
3394 | 1811 | })) | 1811 | })) |
3395 | 1812 | 1812 | ||
3396 | 1813 | def tearDown(self): | 1813 | def tearDown(self): |
3398 | 1814 | super(TestViaCelery, self).tearDown() | 1814 | super().tearDown() |
3399 | 1815 | pop_remote_notifications() | 1815 | pop_remote_notifications() |
3400 | 1816 | 1816 | ||
3401 | 1817 | def test_run(self): | 1817 | def test_run(self): |
3402 | diff --git a/lib/lp/soyuz/tests/test_packageset.py b/lib/lp/soyuz/tests/test_packageset.py | |||
3403 | index c84b2be..da91a35 100644 | |||
3404 | --- a/lib/lp/soyuz/tests/test_packageset.py | |||
3405 | +++ b/lib/lp/soyuz/tests/test_packageset.py | |||
3406 | @@ -35,7 +35,7 @@ class TestPackagesetSet(TestCaseWithFactory): | |||
3407 | 35 | layer = ZopelessDatabaseLayer | 35 | layer = ZopelessDatabaseLayer |
3408 | 36 | 36 | ||
3409 | 37 | def setUp(self): | 37 | def setUp(self): |
3411 | 38 | super(TestPackagesetSet, self).setUp() | 38 | super().setUp() |
3412 | 39 | self.ps_set = getUtility(IPackagesetSet) | 39 | self.ps_set = getUtility(IPackagesetSet) |
3413 | 40 | 40 | ||
3414 | 41 | def getUbuntu(self): | 41 | def getUbuntu(self): |
3415 | @@ -223,7 +223,7 @@ class TestPackagesetSetPermissions(TestCaseWithFactory): | |||
3416 | 223 | layer = DatabaseFunctionalLayer | 223 | layer = DatabaseFunctionalLayer |
3417 | 224 | 224 | ||
3418 | 225 | def setUp(self): | 225 | def setUp(self): |
3420 | 226 | super(TestPackagesetSetPermissions, self).setUp() | 226 | super().setUp() |
3421 | 227 | self.ps_set = getUtility(IPackagesetSet) | 227 | self.ps_set = getUtility(IPackagesetSet) |
3422 | 228 | 228 | ||
3423 | 229 | def test_create_packageset_as_user(self): | 229 | def test_create_packageset_as_user(self): |
3424 | @@ -256,7 +256,7 @@ class TestPackageset(TestCaseWithFactory): | |||
3425 | 256 | 256 | ||
3426 | 257 | def setUp(self): | 257 | def setUp(self): |
3427 | 258 | """Setup a distribution with multiple distroseries.""" | 258 | """Setup a distribution with multiple distroseries.""" |
3429 | 259 | super(TestPackageset, self).setUp() | 259 | super().setUp() |
3430 | 260 | self.distribution = getUtility(IDistributionSet).getByName( | 260 | self.distribution = getUtility(IDistributionSet).getByName( |
3431 | 261 | 'ubuntu') | 261 | 'ubuntu') |
3432 | 262 | self.distroseries_current = self.distribution.currentseries | 262 | self.distroseries_current = self.distribution.currentseries |
3433 | @@ -664,7 +664,7 @@ class TestPackagesetPermissions(TestCaseWithFactory): | |||
3434 | 664 | layer = DatabaseFunctionalLayer | 664 | layer = DatabaseFunctionalLayer |
3435 | 665 | 665 | ||
3436 | 666 | def setUp(self): | 666 | def setUp(self): |
3438 | 667 | super(TestPackagesetPermissions, self).setUp() | 667 | super().setUp() |
3439 | 668 | self.person = self.factory.makePerson() | 668 | self.person = self.factory.makePerson() |
3440 | 669 | self.person2 = self.factory.makePerson() | 669 | self.person2 = self.factory.makePerson() |
3441 | 670 | self.packageset = self.factory.makePackageset(owner=self.person) | 670 | self.packageset = self.factory.makePackageset(owner=self.person) |
3442 | @@ -723,7 +723,7 @@ class TestArchivePermissionSet(TestCaseWithFactory): | |||
3443 | 723 | layer = ZopelessDatabaseLayer | 723 | layer = ZopelessDatabaseLayer |
3444 | 724 | 724 | ||
3445 | 725 | def setUp(self): | 725 | def setUp(self): |
3447 | 726 | super(TestArchivePermissionSet, self).setUp() | 726 | super().setUp() |
3448 | 727 | self.ap_set = getUtility(IArchivePermissionSet) | 727 | self.ap_set = getUtility(IArchivePermissionSet) |
3449 | 728 | self.archive = self.factory.makeArchive() | 728 | self.archive = self.factory.makeArchive() |
3450 | 729 | self.packageset = self.factory.makePackageset() | 729 | self.packageset = self.factory.makePackageset() |
3451 | diff --git a/lib/lp/soyuz/tests/test_packageupload.py b/lib/lp/soyuz/tests/test_packageupload.py | |||
3452 | index 24fb049..24d21ca 100644 | |||
3453 | --- a/lib/lp/soyuz/tests/test_packageupload.py | |||
3454 | +++ b/lib/lp/soyuz/tests/test_packageupload.py | |||
3455 | @@ -85,11 +85,11 @@ class PackageUploadTestCase(TestCaseWithFactory): | |||
3456 | 85 | dbuser = config.uploadqueue.dbuser | 85 | dbuser = config.uploadqueue.dbuser |
3457 | 86 | 86 | ||
3458 | 87 | def setUp(self): | 87 | def setUp(self): |
3460 | 88 | super(PackageUploadTestCase, self).setUp() | 88 | super().setUp() |
3461 | 89 | self.test_publisher = SoyuzTestPublisher() | 89 | self.test_publisher = SoyuzTestPublisher() |
3462 | 90 | 90 | ||
3463 | 91 | def tearDown(self): | 91 | def tearDown(self): |
3465 | 92 | super(PackageUploadTestCase, self).tearDown() | 92 | super().tearDown() |
3466 | 93 | if os.path.exists(config.personalpackagearchive.root): | 93 | if os.path.exists(config.personalpackagearchive.root): |
3467 | 94 | shutil.rmtree(config.personalpackagearchive.root) | 94 | shutil.rmtree(config.personalpackagearchive.root) |
3468 | 95 | 95 | ||
3469 | @@ -692,7 +692,7 @@ class TestPackageUploadSet(TestCaseWithFactory): | |||
3470 | 692 | layer = LaunchpadZopelessLayer | 692 | layer = LaunchpadZopelessLayer |
3471 | 693 | 693 | ||
3472 | 694 | def setUp(self): | 694 | def setUp(self): |
3474 | 695 | super(TestPackageUploadSet, self).setUp() | 695 | super().setUp() |
3475 | 696 | self.upload_set = getUtility(IPackageUploadSet) | 696 | self.upload_set = getUtility(IPackageUploadSet) |
3476 | 697 | 697 | ||
3477 | 698 | def test_PackageUploadSet_implements_IPackageUploadSet(self): | 698 | def test_PackageUploadSet_implements_IPackageUploadSet(self): |
3478 | @@ -1013,7 +1013,7 @@ class TestPackageUploadWebservice(TestCaseWithFactory): | |||
3479 | 1013 | layer = LaunchpadFunctionalLayer | 1013 | layer = LaunchpadFunctionalLayer |
3480 | 1014 | 1014 | ||
3481 | 1015 | def setUp(self): | 1015 | def setUp(self): |
3483 | 1016 | super(TestPackageUploadWebservice, self).setUp() | 1016 | super().setUp() |
3484 | 1017 | self.webservice = None | 1017 | self.webservice = None |
3485 | 1018 | self.distroseries = self.factory.makeDistroSeries() | 1018 | self.distroseries = self.factory.makeDistroSeries() |
3486 | 1019 | self.main = self.factory.makeComponent("main") | 1019 | self.main = self.factory.makeComponent("main") |
3487 | diff --git a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py | |||
3488 | index 1b7ab86..8d7255d 100644 | |||
3489 | --- a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py | |||
3490 | +++ b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py | |||
3491 | @@ -56,7 +56,7 @@ class TestBugIDsFromChangesFile(TestCaseWithFactory): | |||
3492 | 56 | dbuser = config.uploadqueue.dbuser | 56 | dbuser = config.uploadqueue.dbuser |
3493 | 57 | 57 | ||
3494 | 58 | def setUp(self): | 58 | def setUp(self): |
3496 | 59 | super(TestBugIDsFromChangesFile, self).setUp() | 59 | super().setUp() |
3497 | 60 | self.changes = Changes({ | 60 | self.changes = Changes({ |
3498 | 61 | 'Format': '1.8', | 61 | 'Format': '1.8', |
3499 | 62 | 'Source': 'swat', | 62 | 'Source': 'swat', |
3500 | @@ -260,7 +260,7 @@ class TestCloseBugIDsForSourcePackageRelease(TestCaseWithFactory): | |||
3501 | 260 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser | 260 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser |
3502 | 261 | 261 | ||
3503 | 262 | def setUp(self): | 262 | def setUp(self): |
3505 | 263 | super(TestCloseBugIDsForSourcePackageRelease, self).setUp() | 263 | super().setUp() |
3506 | 264 | # Create a distribution with two series, two source package names, | 264 | # Create a distribution with two series, two source package names, |
3507 | 265 | # and an SPR and a bug task for all combinations of those. | 265 | # and an SPR and a bug task for all combinations of those. |
3508 | 266 | self.distro = self.factory.makeDistribution() | 266 | self.distro = self.factory.makeDistribution() |
3509 | @@ -324,7 +324,7 @@ class TestProcessAcceptedBugsJob(TestCaseWithFactory): | |||
3510 | 324 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser | 324 | dbuser = config.IProcessAcceptedBugsJobSource.dbuser |
3511 | 325 | 325 | ||
3512 | 326 | def setUp(self): | 326 | def setUp(self): |
3514 | 327 | super(TestProcessAcceptedBugsJob, self).setUp() | 327 | super().setUp() |
3515 | 328 | self.publisher = SoyuzTestPublisher() | 328 | self.publisher = SoyuzTestPublisher() |
3516 | 329 | self.publisher.prepareBreezyAutotest() | 329 | self.publisher.prepareBreezyAutotest() |
3517 | 330 | self.distroseries = self.publisher.breezy_autotest | 330 | self.distroseries = self.publisher.breezy_autotest |
3518 | diff --git a/lib/lp/soyuz/tests/test_publishing.py b/lib/lp/soyuz/tests/test_publishing.py | |||
3519 | index ec6f426..fbb19f0 100644 | |||
3520 | --- a/lib/lp/soyuz/tests/test_publishing.py | |||
3521 | +++ b/lib/lp/soyuz/tests/test_publishing.py | |||
3522 | @@ -592,12 +592,12 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher): | |||
3523 | 592 | dbuser = config.archivepublisher.dbuser | 592 | dbuser = config.archivepublisher.dbuser |
3524 | 593 | 593 | ||
3525 | 594 | def __init__(self, methodName='runTest'): | 594 | def __init__(self, methodName='runTest'): |
3527 | 595 | super(TestNativePublishingBase, self).__init__(methodName=methodName) | 595 | super().__init__(methodName=methodName) |
3528 | 596 | SoyuzTestPublisher.__init__(self) | 596 | SoyuzTestPublisher.__init__(self) |
3529 | 597 | 597 | ||
3530 | 598 | def setUp(self): | 598 | def setUp(self): |
3531 | 599 | """Setup a pool dir, the librarian, and instantiate the DiskPool.""" | 599 | """Setup a pool dir, the librarian, and instantiate the DiskPool.""" |
3533 | 600 | super(TestNativePublishingBase, self).setUp() | 600 | super().setUp() |
3534 | 601 | switch_dbuser(config.archivepublisher.dbuser) | 601 | switch_dbuser(config.archivepublisher.dbuser) |
3535 | 602 | self.prepareBreezyAutotest() | 602 | self.prepareBreezyAutotest() |
3536 | 603 | self.config = getPubConfig(self.ubuntutest.main_archive) | 603 | self.config = getPubConfig(self.ubuntutest.main_archive) |
3537 | @@ -609,7 +609,7 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher): | |||
3538 | 609 | 609 | ||
3539 | 610 | def tearDown(self): | 610 | def tearDown(self): |
3540 | 611 | """Tear down blows the pool dirs away.""" | 611 | """Tear down blows the pool dirs away.""" |
3542 | 612 | super(TestNativePublishingBase, self).tearDown() | 612 | super().tearDown() |
3543 | 613 | for root in ( | 613 | for root in ( |
3544 | 614 | self.config.distroroot, | 614 | self.config.distroroot, |
3545 | 615 | config.personalpackagearchive.root, | 615 | config.personalpackagearchive.root, |
3546 | @@ -862,7 +862,7 @@ class PublishingSetTests(TestCaseWithFactory): | |||
3547 | 862 | layer = DatabaseFunctionalLayer | 862 | layer = DatabaseFunctionalLayer |
3548 | 863 | 863 | ||
3549 | 864 | def setUp(self): | 864 | def setUp(self): |
3551 | 865 | super(PublishingSetTests, self).setUp() | 865 | super().setUp() |
3552 | 866 | self.distroseries = self.factory.makeDistroSeries() | 866 | self.distroseries = self.factory.makeDistroSeries() |
3553 | 867 | self.archive = self.factory.makeArchive( | 867 | self.archive = self.factory.makeArchive( |
3554 | 868 | distribution=self.distroseries.distribution) | 868 | distribution=self.distroseries.distribution) |
3555 | @@ -919,7 +919,7 @@ class TestPublishingSetLite(TestCaseWithFactory): | |||
3556 | 919 | layer = ZopelessDatabaseLayer | 919 | layer = ZopelessDatabaseLayer |
3557 | 920 | 920 | ||
3558 | 921 | def setUp(self): | 921 | def setUp(self): |
3560 | 922 | super(TestPublishingSetLite, self).setUp() | 922 | super().setUp() |
3561 | 923 | self.person = self.factory.makePerson() | 923 | self.person = self.factory.makePerson() |
3562 | 924 | 924 | ||
3563 | 925 | def test_requestDeletion_marks_SPPHs_deleted(self): | 925 | def test_requestDeletion_marks_SPPHs_deleted(self): |
3564 | diff --git a/lib/lp/soyuz/tests/test_publishing_models.py b/lib/lp/soyuz/tests/test_publishing_models.py | |||
3565 | index f91efa4..8fd922b 100644 | |||
3566 | --- a/lib/lp/soyuz/tests/test_publishing_models.py | |||
3567 | +++ b/lib/lp/soyuz/tests/test_publishing_models.py | |||
3568 | @@ -41,7 +41,7 @@ class TestPublishingSet(BaseTestCaseWithThreeBuilds): | |||
3569 | 41 | 41 | ||
3570 | 42 | def setUp(self): | 42 | def setUp(self): |
3571 | 43 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" | 43 | """Use `SoyuzTestPublisher` to publish some sources in archives.""" |
3573 | 44 | super(TestPublishingSet, self).setUp() | 44 | super().setUp() |
3574 | 45 | 45 | ||
3575 | 46 | # Ensure all the builds have been built. | 46 | # Ensure all the builds have been built. |
3576 | 47 | for build in self.builds: | 47 | for build in self.builds: |
3577 | diff --git a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py | |||
3578 | index e1149da..fe2088f 100644 | |||
3579 | --- a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py | |||
3580 | +++ b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py | |||
3581 | @@ -26,7 +26,7 @@ class TestWSGIArchiveAuth(TestCaseWithFactory): | |||
3582 | 26 | layer = ZopelessAppServerLayer | 26 | layer = ZopelessAppServerLayer |
3583 | 27 | 27 | ||
3584 | 28 | def setUp(self): | 28 | def setUp(self): |
3586 | 29 | super(TestWSGIArchiveAuth, self).setUp() | 29 | super().setUp() |
3587 | 30 | self.now = time.time() | 30 | self.now = time.time() |
3588 | 31 | self.useFixture(MonkeyPatch("time.time", lambda: self.now)) | 31 | self.useFixture(MonkeyPatch("time.time", lambda: self.now)) |
3589 | 32 | self.memcache_fixture = self.useFixture(MemcacheFixture()) | 32 | self.memcache_fixture = self.useFixture(MemcacheFixture()) |
3590 | diff --git a/lib/lp/soyuz/xmlrpc/tests/test_archive.py b/lib/lp/soyuz/xmlrpc/tests/test_archive.py | |||
3591 | index d34a879..e487a22 100644 | |||
3592 | --- a/lib/lp/soyuz/xmlrpc/tests/test_archive.py | |||
3593 | +++ b/lib/lp/soyuz/xmlrpc/tests/test_archive.py | |||
3594 | @@ -22,7 +22,7 @@ class TestArchiveAPI(TestCaseWithFactory): | |||
3595 | 22 | layer = LaunchpadFunctionalLayer | 22 | layer = LaunchpadFunctionalLayer |
3596 | 23 | 23 | ||
3597 | 24 | def setUp(self): | 24 | def setUp(self): |
3599 | 25 | super(TestArchiveAPI, self).setUp() | 25 | super().setUp() |
3600 | 26 | self.useFixture(FeatureFixture({NAMED_AUTH_TOKEN_FEATURE_FLAG: "on"})) | 26 | self.useFixture(FeatureFixture({NAMED_AUTH_TOKEN_FEATURE_FLAG: "on"})) |
3601 | 27 | self.archive_api = ArchiveAPI(None, None) | 27 | self.archive_api = ArchiveAPI(None, None) |
3602 | 28 | self.pushConfig( | 28 | self.pushConfig( |
Self-approving (mechanical).