Merge ~cjwatson/launchpad:py3-archiveuploader-doctests-future-imports into launchpad:master
- Git
- lp:~cjwatson/launchpad
- py3-archiveuploader-doctests-future-imports
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 53a0c5f277cc89a4db68e245f5831f2d5991561e |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:py3-archiveuploader-doctests-future-imports |
Merge into: | launchpad:master |
Diff against target: |
530 lines (+71/-69) 11 files modified
lib/lp/archiveuploader/tests/meta-data-custom-files.txt (+1/-1) lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+7/-5) lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt (+5/-5) lib/lp/archiveuploader/tests/nascentupload-ddebs.txt (+13/-13) lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt (+2/-2) lib/lp/archiveuploader/tests/nascentupload-packageset.txt (+4/-4) lib/lp/archiveuploader/tests/nascentupload.txt (+22/-22) lib/lp/archiveuploader/tests/nascentuploadfile.txt (+12/-12) lib/lp/archiveuploader/tests/static-translations.txt (+1/-1) lib/lp/archiveuploader/tests/test_nascentupload_documentation.py (+1/-1) lib/lp/archiveuploader/tests/upload-path-parsing.txt (+3/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+398454@code.launchpad.net |
Commit message
Convert lp.archiveuploader doctests to __future__ imports
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/lib/lp/archiveuploader/tests/meta-data-custom-files.txt b/lib/lp/archiveuploader/tests/meta-data-custom-files.txt | |||
2 | index a5d2d54..cf3042d 100644 | |||
3 | --- a/lib/lp/archiveuploader/tests/meta-data-custom-files.txt | |||
4 | +++ b/lib/lp/archiveuploader/tests/meta-data-custom-files.txt | |||
5 | @@ -16,6 +16,6 @@ PackageUploadCustomFormat.META_DATA. | |||
6 | 16 | ... filepath="", checksums={}, size=1, priority_name="", policy=None, | 16 | ... filepath="", checksums={}, size=1, priority_name="", policy=None, |
7 | 17 | ... component_and_section="main/raw-meta-data", logger=None) | 17 | ... component_and_section="main/raw-meta-data", logger=None) |
8 | 18 | 18 | ||
10 | 19 | >>> print custom_upload_file.custom_type.name | 19 | >>> print(custom_upload_file.custom_type.name) |
11 | 20 | META_DATA | 20 | META_DATA |
12 | 21 | 21 | ||
13 | diff --git a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt | |||
14 | index 4557415..7f9ed4a 100644 | |||
15 | --- a/lib/lp/archiveuploader/tests/nascentupload-announcements.txt | |||
16 | +++ b/lib/lp/archiveuploader/tests/nascentupload-announcements.txt | |||
17 | @@ -45,7 +45,7 @@ A helper function to examine emails that were sent: | |||
18 | 45 | 45 | ||
19 | 46 | >>> def print_addrlist(field): | 46 | >>> def print_addrlist(field): |
20 | 47 | ... for entry in sorted([addr.strip() for addr in field.split(',')]): | 47 | ... for entry in sorted([addr.strip() for addr in field.split(',')]): |
22 | 48 | ... print entry | 48 | ... print(entry) |
23 | 49 | 49 | ||
24 | 50 | Import the test keys to use 'insecure' policy. | 50 | Import the test keys to use 'insecure' policy. |
25 | 51 | 51 | ||
26 | @@ -647,10 +647,12 @@ permitted, but RFC2047-encoded. UTF-8 in the mail content is preserved. | |||
27 | 647 | >>> len(msgs) | 647 | >>> len(msgs) |
28 | 648 | 3 | 648 | 3 |
29 | 649 | 649 | ||
34 | 650 | >>> [message['From'].replace('\n ', ' ') for message in msgs] | 650 | >>> for message in msgs: |
35 | 651 | ['Root <root@localhost>', 'Root <root@localhost>', | 651 | ... print(message['From'].replace('\n ', ' ')) |
36 | 652 | '=?utf-8?q?Non-ascii_changed-by_=C4=8Ciha=C5=99?= | 652 | Root <root@localhost> |
37 | 653 | <daniel.silverstone@canonical.com>'] | 653 | Root <root@localhost> |
38 | 654 | =?utf-8?q?Non-ascii_changed-by_=C4=8Ciha=C5=99?= | ||
39 | 655 | <daniel.silverstone@canonical.com> | ||
40 | 654 | 656 | ||
41 | 655 | UTF-8 text in the changes file that is sent on the email is preserved | 657 | UTF-8 text in the changes file that is sent on the email is preserved |
42 | 656 | in the MIME encoding. Please note also that the person that signed the | 658 | in the MIME encoding. Please note also that the person that signed the |
43 | diff --git a/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt b/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt | |||
44 | index 91db6b5..8ce0f8c 100644 | |||
45 | --- a/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt | |||
46 | +++ b/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt | |||
47 | @@ -48,8 +48,8 @@ Check the current status of the bug we are supposed to fix: | |||
48 | 48 | Inspect the current bugtasks for bug #6: | 48 | Inspect the current bugtasks for bug #6: |
49 | 49 | 49 | ||
50 | 50 | >>> for bugtask in the_bug.bugtasks: | 50 | >>> for bugtask in the_bug.bugtasks: |
53 | 51 | ... print bugtask.title | 51 | ... print(bugtask.title) |
54 | 52 | ... print bugtask.status.name | 52 | ... print(bugtask.status.name) |
55 | 53 | Bug #6 in Mozilla Firefox: "Firefox crashes when ... | 53 | Bug #6 in Mozilla Firefox: "Firefox crashes when ... |
56 | 54 | NEW | 54 | NEW |
57 | 55 | Bug #6 in bar (Ubuntu): "Firefox crashes when ... | 55 | Bug #6 in bar (Ubuntu): "Firefox crashes when ... |
58 | @@ -81,7 +81,7 @@ This new version fixes bug #6 according its changesfiles: | |||
59 | 81 | >>> print(six.ensure_str(bar2_src.changes._dict['Launchpad-bugs-fixed'])) | 81 | >>> print(six.ensure_str(bar2_src.changes._dict['Launchpad-bugs-fixed'])) |
60 | 82 | 6 | 82 | 6 |
61 | 83 | 83 | ||
63 | 84 | >>> print bar2_src.changes.changes_comment | 84 | >>> print(bar2_src.changes.changes_comment) |
64 | 85 | bar (1.0-2) breezy; urgency=low | 85 | bar (1.0-2) breezy; urgency=low |
65 | 86 | <BLANKLINE> | 86 | <BLANKLINE> |
66 | 87 | * A second upload to ensure that binary overrides of _all work | 87 | * A second upload to ensure that binary overrides of _all work |
67 | @@ -103,8 +103,8 @@ FIXRELEASED and bug notification are generated: | |||
68 | 103 | >>> the_bug = getUtility(IBugSet).get(6) | 103 | >>> the_bug = getUtility(IBugSet).get(6) |
69 | 104 | 104 | ||
70 | 105 | >>> for bugtask in the_bug.bugtasks: | 105 | >>> for bugtask in the_bug.bugtasks: |
73 | 106 | ... print bugtask.title | 106 | ... print(bugtask.title) |
74 | 107 | ... print bugtask.status.name | 107 | ... print(bugtask.status.name) |
75 | 108 | Bug #6 in Mozilla Firefox: "Firefox crashes when ... | 108 | Bug #6 in Mozilla Firefox: "Firefox crashes when ... |
76 | 109 | NEW | 109 | NEW |
77 | 110 | Bug #6 in bar (Ubuntu): "Firefox crashes when ... | 110 | Bug #6 in bar (Ubuntu): "Firefox crashes when ... |
78 | diff --git a/lib/lp/archiveuploader/tests/nascentupload-ddebs.txt b/lib/lp/archiveuploader/tests/nascentupload-ddebs.txt | |||
79 | index ad3ab13..980d78d 100644 | |||
80 | --- a/lib/lp/archiveuploader/tests/nascentupload-ddebs.txt | |||
81 | +++ b/lib/lp/archiveuploader/tests/nascentupload-ddebs.txt | |||
82 | @@ -33,7 +33,7 @@ it is in the queue awaiting overrides and acceptance. | |||
83 | 33 | ... 'suite/debug_1.0-1/debug_1.0-1_source.changes') | 33 | ... 'suite/debug_1.0-1/debug_1.0-1_source.changes') |
84 | 34 | >>> src.process() | 34 | >>> src.process() |
85 | 35 | >>> result = src.do_accept() | 35 | >>> result = src.do_accept() |
87 | 36 | >>> print src.queue_root.status.name | 36 | >>> print(src.queue_root.status.name) |
88 | 37 | NEW | 37 | NEW |
89 | 38 | >>> transaction.commit() | 38 | >>> transaction.commit() |
90 | 39 | 39 | ||
91 | @@ -41,13 +41,13 @@ We don't really care where the source ends up, so we just accept the | |||
92 | 41 | default overrides. It is now pending publication. | 41 | default overrides. It is now pending publication. |
93 | 42 | 42 | ||
94 | 43 | >>> src.queue_root.acceptFromQueue() | 43 | >>> src.queue_root.acceptFromQueue() |
96 | 44 | >>> print src.queue_root.status.name | 44 | >>> print(src.queue_root.status.name) |
97 | 45 | DONE | 45 | DONE |
98 | 46 | 46 | ||
99 | 47 | >>> src_pub = src.queue_root.archive.getPublishedSources( | 47 | >>> src_pub = src.queue_root.archive.getPublishedSources( |
100 | 48 | ... name='debug', version='1.0-1', exact_match=True).one() | 48 | ... name='debug', version='1.0-1', exact_match=True).one() |
101 | 49 | 49 | ||
103 | 50 | >>> print src_pub.displayname, src_pub.status.name | 50 | >>> print(src_pub.displayname, src_pub.status.name) |
104 | 51 | debug 1.0-1 in hoary PENDING | 51 | debug 1.0-1 in hoary PENDING |
105 | 52 | 52 | ||
106 | 53 | At this point a deb and a ddeb, produced during a normal build | 53 | At this point a deb and a ddeb, produced during a normal build |
107 | @@ -61,7 +61,7 @@ Because the DEB is new, the binary upload is held in NEW. | |||
108 | 61 | 61 | ||
109 | 62 | >>> bin.process() | 62 | >>> bin.process() |
110 | 63 | >>> result = bin.do_accept() | 63 | >>> result = bin.do_accept() |
112 | 64 | >>> print bin.queue_root.status.name | 64 | >>> print(bin.queue_root.status.name) |
113 | 65 | NEW | 65 | NEW |
114 | 66 | 66 | ||
115 | 67 | This upload has one build with two binaries: a DEB and its corresponding | 67 | This upload has one build with two binaries: a DEB and its corresponding |
116 | @@ -70,9 +70,9 @@ DDEB. | |||
117 | 70 | >>> build = bin.queue_root.builds[0].build | 70 | >>> build = bin.queue_root.builds[0].build |
118 | 71 | >>> build.binarypackages.count() | 71 | >>> build.binarypackages.count() |
119 | 72 | 2 | 72 | 2 |
121 | 73 | >>> print build.binarypackages[0].binpackageformat.name | 73 | >>> print(build.binarypackages[0].binpackageformat.name) |
122 | 74 | DEB | 74 | DEB |
124 | 75 | >>> print build.binarypackages[1].binpackageformat.name | 75 | >>> print(build.binarypackages[1].binpackageformat.name) |
125 | 76 | DDEB | 76 | DDEB |
126 | 77 | >>> build.binarypackages[0].debug_package == build.binarypackages[1] | 77 | >>> build.binarypackages[0].debug_package == build.binarypackages[1] |
127 | 78 | True | 78 | True |
128 | @@ -95,7 +95,7 @@ We override the binary to main/devel, and accept it into the archive. | |||
129 | 95 | True | 95 | True |
130 | 96 | >>> bin.queue_root.acceptFromQueue() | 96 | >>> bin.queue_root.acceptFromQueue() |
131 | 97 | 97 | ||
133 | 98 | >>> print bin.queue_root.status.name | 98 | >>> print(bin.queue_root.status.name) |
134 | 99 | ACCEPTED | 99 | ACCEPTED |
135 | 100 | 100 | ||
136 | 101 | >>> switch_dbuser(config.uploadqueue.dbuser) | 101 | >>> switch_dbuser(config.uploadqueue.dbuser) |
137 | @@ -108,9 +108,9 @@ We override the binary to main/devel, and accept it into the archive. | |||
138 | 108 | Now, both, binary and debug-symbol packages are pending publication. | 108 | Now, both, binary and debug-symbol packages are pending publication. |
139 | 109 | 109 | ||
140 | 110 | >>> for bin_pub in bin_pubs: | 110 | >>> for bin_pub in bin_pubs: |
142 | 111 | ... print '%s %s %s %s' % ( | 111 | ... print('%s %s %s %s' % ( |
143 | 112 | ... bin_pub.displayname, bin_pub.status.name, | 112 | ... bin_pub.displayname, bin_pub.status.name, |
145 | 113 | ... bin_pub.component.name, bin_pub.section.name) | 113 | ... bin_pub.component.name, bin_pub.section.name)) |
146 | 114 | debug-bin 1.0-1 in hoary i386 PENDING main devel | 114 | debug-bin 1.0-1 in hoary i386 PENDING main devel |
147 | 115 | debug-bin-dbgsym 1.0-1 in hoary i386 PENDING main devel | 115 | debug-bin-dbgsym 1.0-1 in hoary i386 PENDING main devel |
148 | 116 | 116 | ||
149 | @@ -123,18 +123,18 @@ The DDEB is stored appropriately in the database. | |||
150 | 123 | >>> [deb_pub, ddeb_pub] = bin_pubs | 123 | >>> [deb_pub, ddeb_pub] = bin_pubs |
151 | 124 | >>> ddeb = ddeb_pub.binarypackagerelease | 124 | >>> ddeb = ddeb_pub.binarypackagerelease |
152 | 125 | 125 | ||
154 | 126 | >>> print ddeb.title | 126 | >>> print(ddeb.title) |
155 | 127 | debug-bin-dbgsym-1.0-1 | 127 | debug-bin-dbgsym-1.0-1 |
156 | 128 | 128 | ||
157 | 129 | The corresponding `BinaryPackageRelease` is recorded with DDEB format. | 129 | The corresponding `BinaryPackageRelease` is recorded with DDEB format. |
158 | 130 | 130 | ||
160 | 131 | >>> print ddeb.binpackageformat.name | 131 | >>> print(ddeb.binpackageformat.name) |
161 | 132 | DDEB | 132 | DDEB |
162 | 133 | 133 | ||
163 | 134 | And its corresponding file is also stored as DDEB filetype. | 134 | And its corresponding file is also stored as DDEB filetype. |
164 | 135 | 135 | ||
165 | 136 | >>> for bin_file in ddeb.files: | 136 | >>> for bin_file in ddeb.files: |
167 | 137 | ... print bin_file.libraryfile.filename, bin_file.filetype.name | 137 | ... print(bin_file.libraryfile.filename, bin_file.filetype.name) |
168 | 138 | debug-bin-dbgsym_1.0-1_i386.ddeb DDEB | 138 | debug-bin-dbgsym_1.0-1_i386.ddeb DDEB |
169 | 139 | 139 | ||
170 | 140 | 140 | ||
171 | @@ -150,5 +150,5 @@ rejected. | |||
172 | 150 | >>> bin.process() | 150 | >>> bin.process() |
173 | 151 | >>> bin.is_rejected | 151 | >>> bin.is_rejected |
174 | 152 | True | 152 | True |
176 | 153 | >>> print bin.rejection_message | 153 | >>> print(bin.rejection_message) |
177 | 154 | Orphaned debug packages: not-debug-bin-dbgsym 1.0-1 (i386) | 154 | Orphaned debug packages: not-debug-bin-dbgsym 1.0-1 (i386) |
178 | diff --git a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt | |||
179 | index 1ba7b85..45190aa 100644 | |||
180 | --- a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt | |||
181 | +++ b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt | |||
182 | @@ -17,7 +17,7 @@ pocket. | |||
183 | 17 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] | 17 | >>> ubuntu = getUtility(IDistributionSet)['ubuntu'] |
184 | 18 | >>> hoary = ubuntu.getSeries('hoary') | 18 | >>> hoary = ubuntu.getSeries('hoary') |
185 | 19 | 19 | ||
187 | 20 | >>> print hoary.status.name | 20 | >>> print(hoary.status.name) |
188 | 21 | DEVELOPMENT | 21 | DEVELOPMENT |
189 | 22 | 22 | ||
190 | 23 | 23 | ||
191 | @@ -68,7 +68,7 @@ Upload 'epoched' bar version: | |||
192 | 68 | >>> bar_src_upload = getUploadForSource( | 68 | >>> bar_src_upload = getUploadForSource( |
193 | 69 | ... 'suite/bar_1.0-1_epoched/bar_1.0-1_source.changes') | 69 | ... 'suite/bar_1.0-1_epoched/bar_1.0-1_source.changes') |
194 | 70 | >>> bar_src_upload.process() | 70 | >>> bar_src_upload.process() |
196 | 71 | >>> print bar_src_upload.rejection_message | 71 | >>> print(bar_src_upload.rejection_message) |
197 | 72 | File bar_1.0-1.diff.gz already exists in Primary Archive for Ubuntu | 72 | File bar_1.0-1.diff.gz already exists in Primary Archive for Ubuntu |
198 | 73 | Linux, but uploaded version has different contents. See more | 73 | Linux, but uploaded version has different contents. See more |
199 | 74 | information about this error in | 74 | information about this error in |
200 | diff --git a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt | |||
201 | index a3b7b62..6ad0c8f 100644 | |||
202 | --- a/lib/lp/archiveuploader/tests/nascentupload-packageset.txt | |||
203 | +++ b/lib/lp/archiveuploader/tests/nascentupload-packageset.txt | |||
204 | @@ -40,7 +40,7 @@ This time the upload will fail because the ACLs don't let | |||
205 | 40 | >>> bar_failed.process() | 40 | >>> bar_failed.process() |
206 | 41 | >>> bar_failed.is_rejected | 41 | >>> bar_failed.is_rejected |
207 | 42 | True | 42 | True |
209 | 43 | >>> print bar_failed.rejection_message | 43 | >>> print(bar_failed.rejection_message) |
210 | 44 | The signer of this package has no upload rights to this distribution's | 44 | The signer of this package has no upload rights to this distribution's |
211 | 45 | primary archive. Did you mean to upload to a PPA? | 45 | primary archive. Did you mean to upload to a PPA? |
212 | 46 | 46 | ||
213 | @@ -112,7 +112,7 @@ Let's retry the upload. | |||
214 | 112 | >>> bar_failed.process() | 112 | >>> bar_failed.process() |
215 | 113 | >>> bar_failed.is_rejected | 113 | >>> bar_failed.is_rejected |
216 | 114 | True | 114 | True |
218 | 115 | >>> print bar_failed.rejection_message | 115 | >>> print(bar_failed.rejection_message) |
219 | 116 | The signer of this package is lacking the upload rights for the source | 116 | The signer of this package is lacking the upload rights for the source |
220 | 117 | package, component or package set in question. | 117 | package, component or package set in question. |
221 | 118 | 118 | ||
222 | @@ -135,7 +135,7 @@ Add 'bar' to the 'foo' package set. | |||
223 | 135 | Now 'bar' is included by the 'foo' package set. | 135 | Now 'bar' is included by the 'foo' package set. |
224 | 136 | 136 | ||
225 | 137 | >>> [ps] = ps_set.setsIncludingSource('bar', direct_inclusion=True) | 137 | >>> [ps] = ps_set.setsIncludingSource('bar', direct_inclusion=True) |
227 | 138 | >>> print ps.name | 138 | >>> print(ps.name) |
228 | 139 | foo-pkg-set | 139 | foo-pkg-set |
229 | 140 | 140 | ||
230 | 141 | name16 has no package set based upload privileges for 'bar' yet. | 141 | name16 has no package set based upload privileges for 'bar' yet. |
231 | @@ -169,5 +169,5 @@ With the authorization above the upload should work again. | |||
232 | 169 | >>> bar2.is_rejected | 169 | >>> bar2.is_rejected |
233 | 170 | False | 170 | False |
234 | 171 | 171 | ||
236 | 172 | >>> print bar2.rejection_message | 172 | >>> print(bar2.rejection_message) |
237 | 173 | 173 | ||
238 | diff --git a/lib/lp/archiveuploader/tests/nascentupload.txt b/lib/lp/archiveuploader/tests/nascentupload.txt | |||
239 | index 37f6836..20fb5f1 100644 | |||
240 | --- a/lib/lp/archiveuploader/tests/nascentupload.txt | |||
241 | +++ b/lib/lp/archiveuploader/tests/nascentupload.txt | |||
242 | @@ -60,7 +60,7 @@ on that. | |||
243 | 60 | lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing. | 60 | lp.archiveuploader.nascentupload.EarlyReturnUploadError: An error occurred that prevented further processing. |
244 | 61 | >>> nonexistent.is_rejected | 61 | >>> nonexistent.is_rejected |
245 | 62 | True | 62 | True |
247 | 63 | >>> print nonexistent.rejection_message | 63 | >>> print(nonexistent.rejection_message) |
248 | 64 | Unable to read DOES-NOT-EXIST: ... | 64 | Unable to read DOES-NOT-EXIST: ... |
249 | 65 | 65 | ||
250 | 66 | >>> quodlibet = NascentUpload.from_changesfile_path( | 66 | >>> quodlibet = NascentUpload.from_changesfile_path( |
251 | @@ -68,7 +68,7 @@ on that. | |||
252 | 68 | ... anything_policy, DevNullLogger()) | 68 | ... anything_policy, DevNullLogger()) |
253 | 69 | >>> quodlibet.process() | 69 | >>> quodlibet.process() |
254 | 70 | >>> for f in quodlibet.changes.files: | 70 | >>> for f in quodlibet.changes.files: |
256 | 71 | ... print f.filename, f | 71 | ... print(f.filename, f) |
257 | 72 | quodlibet_0.13.1-1_all.deb <...DebBinaryUploadFile...> | 72 | quodlibet_0.13.1-1_all.deb <...DebBinaryUploadFile...> |
258 | 73 | quodlibet-ext_0.13.1-1_i386.deb <...DebBinaryUploadFile...> | 73 | quodlibet-ext_0.13.1-1_i386.deb <...DebBinaryUploadFile...> |
259 | 74 | 74 | ||
260 | @@ -119,7 +119,7 @@ is 'native' (only a TARBALL, no diff + orig) or 'has_orig' (uses ORIG | |||
261 | 119 | 119 | ||
262 | 120 | >>> ed_source_upload.process() | 120 | >>> ed_source_upload.process() |
263 | 121 | >>> for f in ed_source_upload.changes.files: | 121 | >>> for f in ed_source_upload.changes.files: |
265 | 122 | ... print f.filename, f | 122 | ... print(f.filename, f) |
266 | 123 | ed_0.2-20.dsc <...DSCFile...> | 123 | ed_0.2-20.dsc <...DSCFile...> |
267 | 124 | ed_0.2-20.diff.gz <...SourceUploadFile...> | 124 | ed_0.2-20.diff.gz <...SourceUploadFile...> |
268 | 125 | ed_0.2.orig.tar.gz <...SourceUploadFile...> | 125 | ed_0.2.orig.tar.gz <...SourceUploadFile...> |
269 | @@ -129,7 +129,7 @@ try and parse the maintainer for it: | |||
270 | 129 | 129 | ||
271 | 130 | >>> ed_source_upload.changes.signer is None | 130 | >>> ed_source_upload.changes.signer is None |
272 | 131 | True | 131 | True |
274 | 132 | >>> print ed_source_upload.changes.maintainer | 132 | >>> print(ed_source_upload.changes.maintainer) |
275 | 133 | None | 133 | None |
276 | 134 | 134 | ||
277 | 135 | ed_source upload is *sourceful*: | 135 | ed_source upload is *sourceful*: |
278 | @@ -177,7 +177,7 @@ Let's try a simple binary upload: | |||
279 | 177 | 177 | ||
280 | 178 | >>> ed_binary_upload.process() | 178 | >>> ed_binary_upload.process() |
281 | 179 | >>> for f in ed_binary_upload.changes.files: | 179 | >>> for f in ed_binary_upload.changes.files: |
283 | 180 | ... print f.filename, f | 180 | ... print(f.filename, f) |
284 | 181 | ed_0.2-20_i386.deb <...DebBinaryUploadFile...> | 181 | ed_0.2-20_i386.deb <...DebBinaryUploadFile...> |
285 | 182 | 182 | ||
286 | 183 | ed_binary is *binaryful*: | 183 | ed_binary is *binaryful*: |
287 | @@ -209,7 +209,7 @@ parse the maintainer for them either: | |||
288 | 209 | 209 | ||
289 | 210 | >>> ed_binary_upload.changes.signer is None | 210 | >>> ed_binary_upload.changes.signer is None |
290 | 211 | True | 211 | True |
292 | 212 | >>> print ed_binary_upload.changes.maintainer | 212 | >>> print(ed_binary_upload.changes.maintainer) |
293 | 213 | None | 213 | None |
294 | 214 | 214 | ||
295 | 215 | Other ChangesFile information are also checked across the uploads | 215 | Other ChangesFile information are also checked across the uploads |
296 | @@ -228,7 +228,7 @@ should match the files target architectures: | |||
297 | 228 | >>> ed_mismatched_upload.process() | 228 | >>> ed_mismatched_upload.process() |
298 | 229 | 229 | ||
299 | 230 | >>> for f in ed_mismatched_upload.changes.files: | 230 | >>> for f in ed_mismatched_upload.changes.files: |
301 | 231 | ... print f.filename, f | 231 | ... print(f.filename, f) |
302 | 232 | ed_0.2-20_i386.deb <...DebBinaryUploadFile...> | 232 | ed_0.2-20_i386.deb <...DebBinaryUploadFile...> |
303 | 233 | 233 | ||
304 | 234 | >>> for a in ed_mismatched_upload.changes.architectures: | 234 | >>> for a in ed_mismatched_upload.changes.architectures: |
305 | @@ -238,7 +238,7 @@ should match the files target architectures: | |||
306 | 238 | Since the changesfile specify that only 'amd64' will be used and | 238 | Since the changesfile specify that only 'amd64' will be used and |
307 | 239 | there is a file that depends on 'i386' the upload is rejected: | 239 | there is a file that depends on 'i386' the upload is rejected: |
308 | 240 | 240 | ||
310 | 241 | >>> print ed_mismatched_upload.rejection_message | 241 | >>> print(ed_mismatched_upload.rejection_message) |
311 | 242 | ed_0.2-20_i386.deb: control file lists arch as 'i386' which isn't in the | 242 | ed_0.2-20_i386.deb: control file lists arch as 'i386' which isn't in the |
312 | 243 | changes file. | 243 | changes file. |
313 | 244 | 244 | ||
314 | @@ -331,7 +331,7 @@ Retrive the just-inserted SourcePackageRelease correspondent to 'ed' | |||
315 | 331 | Check if we have rebuid the change's author line properly (as | 331 | Check if we have rebuid the change's author line properly (as |
316 | 332 | mentioned in bug # 30621) | 332 | mentioned in bug # 30621) |
317 | 333 | 333 | ||
319 | 334 | >>> print ed_spr.changelog_entry #doctest: -NORMALIZE_WHITESPACE | 334 | >>> print(ed_spr.changelog_entry) #doctest: -NORMALIZE_WHITESPACE |
320 | 335 | ed (0.2-20) unstable; urgency=low | 335 | ed (0.2-20) unstable; urgency=low |
321 | 336 | <BLANKLINE> | 336 | <BLANKLINE> |
322 | 337 | * Move to dpatch; existing non-debian/ changes split into | 337 | * Move to dpatch; existing non-debian/ changes split into |
323 | @@ -383,7 +383,7 @@ The content of 'debian/copyright' is stored as the 'copyright' | |||
324 | 383 | attribute of SourcePackageRelease (note that its content is filtered | 383 | attribute of SourcePackageRelease (note that its content is filtered |
325 | 384 | with encoding.guess()). | 384 | with encoding.guess()). |
326 | 385 | 385 | ||
328 | 386 | >>> print ed_spr.copyright | 386 | >>> print(ed_spr.copyright) |
329 | 387 | This is Debian GNU's prepackaged version of the FSF's GNU ed | 387 | This is Debian GNU's prepackaged version of the FSF's GNU ed |
330 | 388 | ... | 388 | ... |
331 | 389 | by the Foundation. | 389 | by the Foundation. |
332 | @@ -420,7 +420,7 @@ On the absence of debian/copyright a warning is issued in the upload | |||
333 | 420 | processing log messages, then it can be further checked in Soyuz | 420 | processing log messages, then it can be further checked in Soyuz |
334 | 421 | production mailbox. | 421 | production mailbox. |
335 | 422 | 422 | ||
337 | 423 | >>> print nocopyright_src.warning_message | 423 | >>> print(nocopyright_src.warning_message) |
338 | 424 | <BLANKLINE> | 424 | <BLANKLINE> |
339 | 425 | Upload Warnings: | 425 | Upload Warnings: |
340 | 426 | No copyright file found. | 426 | No copyright file found. |
341 | @@ -484,7 +484,7 @@ The upload will be rejected. | |||
342 | 484 | >>> ed_src_dup.is_rejected | 484 | >>> ed_src_dup.is_rejected |
343 | 485 | True | 485 | True |
344 | 486 | 486 | ||
346 | 487 | >>> print ed_src_dup.rejection_message | 487 | >>> print(ed_src_dup.rejection_message) |
347 | 488 | The source ed - 0.2-20 is already accepted in ubuntu/hoary and you | 488 | The source ed - 0.2-20 is already accepted in ubuntu/hoary and you |
348 | 489 | cannot upload the same version within the same distribution. You | 489 | cannot upload the same version within the same distribution. You |
349 | 490 | have to modify the source version and re-upload. | 490 | have to modify the source version and re-upload. |
350 | @@ -652,14 +652,14 @@ overridden by the changesfile: | |||
351 | 652 | 652 | ||
352 | 653 | >>> success = ed_src.do_accept() | 653 | >>> success = ed_src.do_accept() |
353 | 654 | 654 | ||
355 | 655 | >>> print ed_src.queue_root.pocket.name | 655 | >>> print(ed_src.queue_root.pocket.name) |
356 | 656 | UPDATES | 656 | UPDATES |
357 | 657 | 657 | ||
358 | 658 | Even though this went to a pocket and thus would be unapproved rather | 658 | Even though this went to a pocket and thus would be unapproved rather |
359 | 659 | than accepted, the ed upload ought still make it to NEW instead of | 659 | than accepted, the ed upload ought still make it to NEW instead of |
360 | 660 | unapproved. | 660 | unapproved. |
361 | 661 | 661 | ||
363 | 662 | >>> print ed_src.queue_root.status.name | 662 | >>> print(ed_src.queue_root.status.name) |
364 | 663 | NEW | 663 | NEW |
365 | 664 | 664 | ||
366 | 665 | And pop it back to development now that we're done | 665 | And pop it back to development now that we're done |
367 | @@ -676,7 +676,7 @@ Check the uploader behaviour against a missing orig.tar.gz file, | |||
368 | 676 | >>> ed21_src.process() | 676 | >>> ed21_src.process() |
369 | 677 | >>> ed21_src.is_rejected | 677 | >>> ed21_src.is_rejected |
370 | 678 | True | 678 | True |
372 | 679 | >>> print ed21_src.rejection_message+"\nEND" | 679 | >>> print(ed21_src.rejection_message+"\nEND") |
373 | 680 | Unable to find ed_0.2.orig.tar.gz in upload or distribution. | 680 | Unable to find ed_0.2.orig.tar.gz in upload or distribution. |
374 | 681 | Files specified in DSC are broken or missing, skipping package unpack | 681 | Files specified in DSC are broken or missing, skipping package unpack |
375 | 682 | verification. | 682 | verification. |
376 | @@ -762,15 +762,15 @@ record is a placeholder one, we used the second key): | |||
377 | 762 | 762 | ||
378 | 763 | >>> name16 = getUtility(IPersonSet).getByName('name16') | 763 | >>> name16 = getUtility(IPersonSet).getByName('name16') |
379 | 764 | >>> uploader_key = name16.gpg_keys[1] | 764 | >>> uploader_key = name16.gpg_keys[1] |
381 | 765 | >>> print uploader_key.fingerprint | 765 | >>> print(uploader_key.fingerprint) |
382 | 766 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 | 766 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
383 | 767 | 767 | ||
384 | 768 | Both, DSC and changesfile are signed with Name16's second key. | 768 | Both, DSC and changesfile are signed with Name16's second key. |
385 | 769 | 769 | ||
387 | 770 | >>> print bar_ok.changes.dsc.signingkey.fingerprint | 770 | >>> print(bar_ok.changes.dsc.signingkey.fingerprint) |
388 | 771 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 | 771 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
389 | 772 | 772 | ||
391 | 773 | >>> print bar_ok.changes.signingkey.fingerprint | 773 | >>> print(bar_ok.changes.signingkey.fingerprint) |
392 | 774 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 | 774 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
393 | 775 | 775 | ||
394 | 776 | Let's modify the current ACL rules for ubuntu, moving the upload | 776 | Let's modify the current ACL rules for ubuntu, moving the upload |
395 | @@ -795,7 +795,7 @@ This time the upload will fail because the ACLs don't let | |||
396 | 795 | >>> bar_failed.process() | 795 | >>> bar_failed.process() |
397 | 796 | >>> bar_failed.is_rejected | 796 | >>> bar_failed.is_rejected |
398 | 797 | True | 797 | True |
400 | 798 | >>> print bar_failed.rejection_message | 798 | >>> print(bar_failed.rejection_message) |
401 | 799 | The signer of this package has no upload rights to this distribution's | 799 | The signer of this package has no upload rights to this distribution's |
402 | 800 | primary archive. Did you mean to upload to a PPA? | 800 | primary archive. Did you mean to upload to a PPA? |
403 | 801 | 801 | ||
404 | @@ -808,10 +808,10 @@ for further checks: | |||
405 | 808 | >>> verifyObject(IGPGKey, bar_failed.changes.signingkey) | 808 | >>> verifyObject(IGPGKey, bar_failed.changes.signingkey) |
406 | 809 | True | 809 | True |
407 | 810 | 810 | ||
409 | 811 | >>> print bar_failed.changes.dsc.signingkey.fingerprint | 811 | >>> print(bar_failed.changes.dsc.signingkey.fingerprint) |
410 | 812 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 | 812 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
411 | 813 | 813 | ||
413 | 814 | >>> print bar_failed.changes.signingkey.fingerprint | 814 | >>> print(bar_failed.changes.signingkey.fingerprint) |
414 | 815 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 | 815 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
415 | 816 | 816 | ||
416 | 817 | The ACL rules also enable us to specify that a user has a | 817 | The ACL rules also enable us to specify that a user has a |
417 | @@ -840,7 +840,7 @@ Now try the "bar" upload: | |||
418 | 840 | >>> bar2.is_rejected | 840 | >>> bar2.is_rejected |
419 | 841 | False | 841 | False |
420 | 842 | 842 | ||
422 | 843 | >>> print bar2.rejection_message | 843 | >>> print(bar2.rejection_message) |
423 | 844 | 844 | ||
424 | 845 | 845 | ||
425 | 846 | Uploads to copy archives | 846 | Uploads to copy archives |
426 | diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt | |||
427 | index 85a2ac7..7af20da 100644 | |||
428 | --- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt | |||
429 | +++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt | |||
430 | @@ -126,7 +126,7 @@ we can deal with the errors later: | |||
431 | 126 | At this point we can inspect the list of files contained in the upload. | 126 | At this point we can inspect the list of files contained in the upload. |
432 | 127 | 127 | ||
433 | 128 | >>> for uploaded_file in ed_binary_changes.files: | 128 | >>> for uploaded_file in ed_binary_changes.files: |
435 | 129 | ... print uploaded_file.filename | 129 | ... print(uploaded_file.filename) |
436 | 130 | ed_0.2-20_i386.deb | 130 | ed_0.2-20_i386.deb |
437 | 131 | 131 | ||
438 | 132 | >>> for f in ed_binary_changes.binary_package_files: | 132 | >>> for f in ed_binary_changes.binary_package_files: |
439 | @@ -181,14 +181,14 @@ regexp, even though it isn't actually a source file: | |||
440 | 181 | 181 | ||
441 | 182 | >>> from lp.archiveuploader.utils import re_issource | 182 | >>> from lp.archiveuploader.utils import re_issource |
442 | 183 | >>> src_match = re_issource.match('dist-upgrader_1.0.tar.gz') | 183 | >>> src_match = re_issource.match('dist-upgrader_1.0.tar.gz') |
451 | 184 | >>> src_match.group(0) | 184 | >>> print(src_match.group(0)) |
452 | 185 | 'dist-upgrader_1.0.tar.gz' | 185 | dist-upgrader_1.0.tar.gz |
453 | 186 | >>> src_match.group(1) | 186 | >>> print(src_match.group(1)) |
454 | 187 | 'dist-upgrader' | 187 | dist-upgrader |
455 | 188 | >>> src_match.group(2) | 188 | >>> print(src_match.group(2)) |
456 | 189 | '1.0' | 189 | 1.0 |
457 | 190 | >>> src_match.group(3) | 190 | >>> print(src_match.group(3)) |
458 | 191 | 'tar.gz' | 191 | tar.gz |
459 | 192 | 192 | ||
460 | 193 | That's why we recognize them by identifying a set of custom sections: | 193 | That's why we recognize them by identifying a set of custom sections: |
461 | 194 | 194 | ||
462 | @@ -444,7 +444,7 @@ Sub-DSCFiles are DSCUploadedFile objects. | |||
463 | 444 | We can also inspect the list of files declared in this DSC: | 444 | We can also inspect the list of files declared in this DSC: |
464 | 445 | 445 | ||
465 | 446 | >>> for dsc_file in ed_source_dsc.files: | 446 | >>> for dsc_file in ed_source_dsc.files: |
467 | 447 | ... print dsc_file.filename | 447 | ... print(dsc_file.filename) |
468 | 448 | ed_0.2.orig.tar.gz | 448 | ed_0.2.orig.tar.gz |
469 | 449 | ed_0.2-20.diff.gz | 449 | ed_0.2-20.diff.gz |
470 | 450 | 450 | ||
471 | @@ -514,7 +514,7 @@ being too new: | |||
472 | 514 | ... 'main/editors', 'important', 'foo', '1.2', ed_binary_changes, | 514 | ... 'main/editors', 'important', 'foo', '1.2', ed_binary_changes, |
473 | 515 | ... old_only_policy, DevNullLogger()) | 515 | ... old_only_policy, DevNullLogger()) |
474 | 516 | >>> list(ed_binary_deb.verifyDebTimestamp()) | 516 | >>> list(ed_binary_deb.verifyDebTimestamp()) |
476 | 517 | [UploadError('ed_0.2-20_i386.deb: | 517 | [UploadError(...'ed_0.2-20_i386.deb: |
477 | 518 | has 26 file(s) with a time stamp too far into the future | 518 | has 26 file(s) with a time stamp too far into the future |
478 | 519 | (e.g. control [Thu Jan 3 19:29:01 2008]).',)] | 519 | (e.g. control [Thu Jan 3 19:29:01 2008]).',)] |
479 | 520 | 520 | ||
480 | @@ -529,6 +529,6 @@ being too new: | |||
481 | 529 | ... 'main/editors', 'important', 'foo', '1.2', ed_binary_changes, | 529 | ... 'main/editors', 'important', 'foo', '1.2', ed_binary_changes, |
482 | 530 | ... new_only_policy, DevNullLogger()) | 530 | ... new_only_policy, DevNullLogger()) |
483 | 531 | >>> list(ed_binary_deb.verify()) | 531 | >>> list(ed_binary_deb.verify()) |
485 | 532 | [UploadError('ed_0.2-20_i386.deb: | 532 | [UploadError(...'ed_0.2-20_i386.deb: |
486 | 533 | has 26 file(s) with a time stamp too far in the past | 533 | has 26 file(s) with a time stamp too far in the past |
487 | 534 | (e.g. control [Thu Jan 3 19:29:01 2008]).',)] | 534 | (e.g. control [Thu Jan 3 19:29:01 2008]).',)] |
488 | diff --git a/lib/lp/archiveuploader/tests/static-translations.txt b/lib/lp/archiveuploader/tests/static-translations.txt | |||
489 | index a6e9ef2..52b7a25 100644 | |||
490 | --- a/lib/lp/archiveuploader/tests/static-translations.txt | |||
491 | +++ b/lib/lp/archiveuploader/tests/static-translations.txt | |||
492 | @@ -14,7 +14,7 @@ PackageUploadCustomFormat.STATIC_TRANSLATIONS. | |||
493 | 14 | ... filepath="", checksums={}, size=1, priority_name="", policy=None, | 14 | ... filepath="", checksums={}, size=1, priority_name="", policy=None, |
494 | 15 | ... component_and_section="main/raw-translations-static", logger=None) | 15 | ... component_and_section="main/raw-translations-static", logger=None) |
495 | 16 | 16 | ||
497 | 17 | >>> print custom_upload_file.custom_type.name | 17 | >>> print(custom_upload_file.custom_type.name) |
498 | 18 | STATIC_TRANSLATIONS | 18 | STATIC_TRANSLATIONS |
499 | 19 | 19 | ||
500 | 20 | Static translations tarballs are not published, they only exist in the | 20 | Static translations tarballs are not published, they only exist in the |
501 | diff --git a/lib/lp/archiveuploader/tests/test_nascentupload_documentation.py b/lib/lp/archiveuploader/tests/test_nascentupload_documentation.py | |||
502 | index 646d7b4..bc18b56 100644 | |||
503 | --- a/lib/lp/archiveuploader/tests/test_nascentupload_documentation.py | |||
504 | +++ b/lib/lp/archiveuploader/tests/test_nascentupload_documentation.py | |||
505 | @@ -65,7 +65,7 @@ def testGlobalsSetup(test): | |||
506 | 65 | We can use the getUpload* without unnecessary imports. | 65 | We can use the getUpload* without unnecessary imports. |
507 | 66 | """ | 66 | """ |
508 | 67 | import_public_test_keys() | 67 | import_public_test_keys() |
510 | 68 | setGlobs(test) | 68 | setGlobs(test, future=True) |
511 | 69 | test.globs['getUploadForSource'] = getUploadForSource | 69 | test.globs['getUploadForSource'] = getUploadForSource |
512 | 70 | test.globs['getUploadForBinary'] = getUploadForBinary | 70 | test.globs['getUploadForBinary'] = getUploadForBinary |
513 | 71 | test.globs['getPPAUploadForSource'] = getPPAUploadForSource | 71 | test.globs['getPPAUploadForSource'] = getPPAUploadForSource |
514 | diff --git a/lib/lp/archiveuploader/tests/upload-path-parsing.txt b/lib/lp/archiveuploader/tests/upload-path-parsing.txt | |||
515 | index 17e8ba9..ea7666e 100644 | |||
516 | --- a/lib/lp/archiveuploader/tests/upload-path-parsing.txt | |||
517 | +++ b/lib/lp/archiveuploader/tests/upload-path-parsing.txt | |||
518 | @@ -14,9 +14,9 @@ in several scenarios. | |||
519 | 14 | >>> def check_upload(relative_path): | 14 | >>> def check_upload(relative_path): |
520 | 15 | ... (distribution, suite_name, archive) = parse_upload_path( | 15 | ... (distribution, suite_name, archive) = parse_upload_path( |
521 | 16 | ... relative_path) | 16 | ... relative_path) |
525 | 17 | ... print 'Archive: %s' % archive.name | 17 | ... print('Archive: %s' % archive.name) |
526 | 18 | ... print 'Distribution: %s' % distribution.name | 18 | ... print('Distribution: %s' % distribution.name) |
527 | 19 | ... print 'Suite: %s' % suite_name | 19 | ... print('Suite: %s' % suite_name) |
528 | 20 | 20 | ||
529 | 21 | 21 | ||
530 | 22 | == Distribution uploads == | 22 | == Distribution uploads == |
Self-approving: this is just more tedious print_function and unicode_literals stuff.