Merge lp:~cjwatson/launchpad/test-domain-prep into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18966
Proposed branch: lp:~cjwatson/launchpad/test-domain-prep
Merge into: lp:launchpad
Diff against target: 300 lines (+41/-47)
5 files modified
lib/lp/code/stories/branches/xx-branch-edit.txt (+7/-6)
lib/lp/soyuz/doc/build-failedtoupload-workflow.txt (+3/-5)
lib/lp/testing/mail_helpers.py (+5/-3)
lib/lp/translations/doc/poexport-queue.txt (+23/-29)
lib/lp/translations/doc/poexport-request.txt (+3/-4)
To merge this branch: bzr merge lp:~cjwatson/launchpad/test-domain-prep
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Launchpad code reviewers Pending
Review via email: mp+367451@code.launchpad.net

Commit message

Prepare some doctests for change to launchpad.test domain.

Description of the change

Some doctests were sensitive to the exact length of URLs, which will change shortly when we rename from launchpad.dev to launchpad.test.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/stories/branches/xx-branch-edit.txt'
--- lib/lp/code/stories/branches/xx-branch-edit.txt 2018-05-13 10:35:52 +0000
+++ lib/lp/code/stories/branches/xx-branch-edit.txt 2019-05-15 08:02:45 +0000
@@ -276,11 +276,11 @@
276 >>> len(stub.test_emails)276 >>> len(stub.test_emails)
277 1277 1
278278
279 >>> print(stub.test_emails[0][2])279 >>> from lp.testing.mail_helpers import print_emails
280 Content-Type: ...280
281 ...281 >>> print_emails(decode=True)
282 From: No Privileges Person <no-priv@canonical.com>
282 To: Sample Person <test@canonical.com>283 To: Sample Person <test@canonical.com>
283 From: No Privileges Person <no-priv@canonical.com>
284 Subject: [Branch ~name12/foogoo/foogoo-svn]284 Subject: [Branch ~name12/foogoo/foogoo-svn]
285 ...285 ...
286 New whiteboard value286 New whiteboard value
@@ -290,9 +290,10 @@
290 http://code.launchpad.dev/~name12/foogoo/foogoo-svn290 http://code.launchpad.dev/~name12/foogoo/foogoo-svn
291 <BLANKLINE>291 <BLANKLINE>
292 You are subscribed to branch lp://dev/~name12/foogoo/foogoo-svn.292 You are subscribed to branch lp://dev/~name12/foogoo/foogoo-svn.
293 To unsubscribe from this branch go to http://code.l.../~name12/foo=293 To unsubscribe from this branch go to
294 goo/foogoo-svn/+edit-subscription294 http://code.l.../~name12/foogoo/foogoo-svn/+edit-subscription
295 <BLANKLINE>295 <BLANKLINE>
296 ----------------------------------------
296297
297298
298Changing the branch owner299Changing the branch owner
299300
=== modified file 'lib/lp/soyuz/doc/build-failedtoupload-workflow.txt'
--- lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2019-01-05 09:21:54 +0000
+++ lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2019-05-15 08:02:45 +0000
@@ -78,7 +78,7 @@
78 >>> build_notification['X-Creator-Recipient']78 >>> build_notification['X-Creator-Recipient']
79 'mark@example.com'79 'mark@example.com'
8080
81 >>> notification_body = build_notification.get_payload()81 >>> notification_body = build_notification.get_payload(decode=True)
82 >>> print(notification_body) #doctest: -NORMALIZE_WHITESPACE82 >>> print(notification_body) #doctest: -NORMALIZE_WHITESPACE
83 <BLANKLINE>83 <BLANKLINE>
84 * Source Package: cdrkit84 * Source Package: cdrkit
@@ -88,8 +88,7 @@
88 * Component: main88 * Component: main
89 * State: Failed to upload89 * State: Failed to upload
90 * Duration: 1 minute90 * Duration: 1 minute
91 * Build Log: http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22/+fil=91 * Build Log: http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22/+files/netapplet-1.0.0.tar.gz
92 es/netapplet-1.0.0.tar.gz
93 * Builder: http://launchpad.dev/builders/bob92 * Builder: http://launchpad.dev/builders/bob
94 * Source: http://launchpad.dev/ubuntu/+source/cdrkit/1.093 * Source: http://launchpad.dev/ubuntu/+source/cdrkit/1.0
95 <BLANKLINE>94 <BLANKLINE>
@@ -100,8 +99,7 @@
100 contact us by asking a question on Launchpad99 contact us by asking a question on Launchpad
101 (https://answers.launchpad.net/launchpad/+addquestion).100 (https://answers.launchpad.net/launchpad/+addquestion).
102 <BLANKLINE>101 <BLANKLINE>
103 -- =102 --
104 <BLANKLINE>
105 i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE103 i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE
106 http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22104 http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22
107 <BLANKLINE>105 <BLANKLINE>
108106
=== modified file 'lib/lp/testing/mail_helpers.py'
--- lib/lp/testing/mail_helpers.py 2015-09-14 14:12:58 +0000
+++ lib/lp/testing/mail_helpers.py 2019-05-15 08:02:45 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2015 Canonical Ltd. This software is licensed under the1# Copyright 2009-2019 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Helper functions dealing with emails in tests.4"""Helper functions dealing with emails in tests.
@@ -60,7 +60,8 @@
6060
61def print_emails(include_reply_to=False, group_similar=False,61def print_emails(include_reply_to=False, group_similar=False,
62 include_rationale=False, include_for=False,62 include_rationale=False, include_for=False,
63 notifications=None, include_notification_type=False):63 notifications=None, include_notification_type=False,
64 decode=False):
64 """Pop all messages from stub.test_emails and print them with65 """Pop all messages from stub.test_emails and print them with
65 their recipients.66 their recipients.
6667
@@ -80,6 +81,7 @@
80 the stack.81 the stack.
81 :param include_notification_type: Include the82 :param include_notification_type: Include the
82 X-Launchpad-Notification-Type header.83 X-Launchpad-Notification-Type header.
84 :param decode: Decode message payloads if True.
83 """85 """
84 distinct_bodies = {}86 distinct_bodies = {}
85 if notifications is None:87 if notifications is None:
@@ -88,7 +90,7 @@
88 recipients = set(90 recipients = set(
89 recipient.strip()91 recipient.strip()
90 for recipient in message['To'].split(','))92 for recipient in message['To'].split(','))
91 body = message.get_payload()93 body = message.get_payload(decode=decode)
92 if group_similar:94 if group_similar:
93 # Strip the first line as it's different for each recipient.95 # Strip the first line as it's different for each recipient.
94 body = body[body.find('\n') + 1:]96 body = body[body.find('\n') + 1:]
9597
=== modified file 'lib/lp/translations/doc/poexport-queue.txt'
--- lib/lp/translations/doc/poexport-queue.txt 2018-06-02 13:37:18 +0000
+++ lib/lp/translations/doc/poexport-queue.txt 2019-05-15 08:02:45 +0000
@@ -74,12 +74,12 @@
7474
75One is for the user with the error notification.75One is for the user with the error notification.
7676
77 >>> print_emails(notifications=[carlos_email])77 >>> print_emails(notifications=[carlos_email], decode=True)
78 From: ...78 From: ...
79 To: carlos@canonical.com79 To: carlos@canonical.com
80 Subject: Launchpad translation download: Evolution trunk -80 Subject: Launchpad translation download: Evolution trunk -
81 evolution-2.2 template81 evolution-2.2 template
82 Hello Carlos Perell=C3=B3 Mar=C3=ADn,82 Hello Carlos Perelló Marín,
83 <BLANKLINE>83 <BLANKLINE>
84 Launchpad encountered problems exporting the files you requested.84 Launchpad encountered problems exporting the files you requested.
85 The Launchpad Translations team has been notified of this problem.85 The Launchpad Translations team has been notified of this problem.
@@ -87,10 +87,9 @@
87 <BLANKLINE>87 <BLANKLINE>
88 If you want to retry your request, you can do so at88 If you want to retry your request, you can do so at
89 <BLANKLINE>89 <BLANKLINE>
90 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=90 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export.
91 port.
92 <BLANKLINE>91 <BLANKLINE>
93 -- =92 --
94 Automatic message from Launchpad.net.93 Automatic message from Launchpad.net.
95 <BLANKLINE>94 <BLANKLINE>
96 ----------------------------------------95 ----------------------------------------
@@ -98,7 +97,7 @@
98And the other to the admins. This one lists the files that were being97And the other to the admins. This one lists the files that were being
99exported as context to help tracking down any bugs.98exported as context to help tracking down any bugs.
10099
101 >>> print_emails(notifications=[admin_email])100 >>> print_emails(notifications=[admin_email], decode=True)
102 From: ...101 From: ...
103 To: launchpad-error-reports@lists.canonical.com102 To: launchpad-error-reports@lists.canonical.com
104 Subject: Launchpad translation download errors: Evolution trunk -103 Subject: Launchpad translation download errors: Evolution trunk -
@@ -106,10 +105,9 @@
106 Hello Launchpad administrators,105 Hello Launchpad administrators,
107 <BLANKLINE>106 <BLANKLINE>
108 Launchpad encountered problems exporting translation files107 Launchpad encountered problems exporting translation files
109 requested by Carlos Perell=C3=B3 Mar=C3=ADn (carlos) at108 requested by Carlos Perelló Marín (carlos) at
110 <BLANKLINE>109 <BLANKLINE>
111 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=110 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
112 port
113 <BLANKLINE>111 <BLANKLINE>
114 This means we have a bug in Launchpad that needs to be fixed112 This means we have a bug in Launchpad that needs to be fixed
115 before this export can proceed. Here is the error we got:113 before this export can proceed. Here is the error we got:
@@ -123,7 +121,7 @@
123 * evolution-2.2 in Evolution trunk121 * evolution-2.2 in Evolution trunk
124 * Spanish (es) translation of evolution-2.2 in Evolution trunk122 * Spanish (es) translation of evolution-2.2 in Evolution trunk
125 <BLANKLINE>123 <BLANKLINE>
126 -- =124 --
127 Automatic message from Launchpad.net.125 Automatic message from Launchpad.net.
128 <BLANKLINE>126 <BLANKLINE>
129 ----------------------------------------127 ----------------------------------------
@@ -153,12 +151,12 @@
153The user's notification looks no different from that for an ordinary151The user's notification looks no different from that for an ordinary
154error.152error.
155153
156 >>> print_emails(notifications=[carlos_email])154 >>> print_emails(notifications=[carlos_email], decode=True)
157 From: ...155 From: ...
158 To: carlos@canonical.com156 To: carlos@canonical.com
159 Subject: Launchpad translation download: Evolution trunk -157 Subject: Launchpad translation download: Evolution trunk -
160 evolution-2.2 template158 evolution-2.2 template
161 Hello Carlos Perell=C3=B3 Mar=C3=ADn,159 Hello Carlos Perelló Marín,
162 <BLANKLINE>160 <BLANKLINE>
163 Launchpad encountered problems exporting the files you requested.161 Launchpad encountered problems exporting the files you requested.
164 The Launchpad Translations team has been notified of this problem.162 The Launchpad Translations team has been notified of this problem.
@@ -166,10 +164,9 @@
166 <BLANKLINE>164 <BLANKLINE>
167 If you want to retry your request, you can do so at165 If you want to retry your request, you can do so at
168 <BLANKLINE>166 <BLANKLINE>
169 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=167 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export.
170 port.
171 <BLANKLINE>168 <BLANKLINE>
172 -- =169 --
173 Automatic message from Launchpad.net.170 Automatic message from Launchpad.net.
174 <BLANKLINE>171 <BLANKLINE>
175 ----------------------------------------172 ----------------------------------------
@@ -177,7 +174,7 @@
177The one for the administrators, however, does not include the174The one for the administrators, however, does not include the
178unprintable exception text.175unprintable exception text.
179176
180 >>> print_emails(notifications=[admin_email])177 >>> print_emails(notifications=[admin_email], decode=True)
181 From: ...178 From: ...
182 To: launchpad-error-reports@lists.canonical.com179 To: launchpad-error-reports@lists.canonical.com
183 Subject: Launchpad translation download errors: Evolution trunk -180 Subject: Launchpad translation download errors: Evolution trunk -
@@ -188,14 +185,13 @@
188 failure during a translation export requested by Carlos ...185 failure during a translation export requested by Carlos ...
189 (carlos) at186 (carlos) at
190 <BLANKLINE>187 <BLANKLINE>
191 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=188 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
192 port
193 <BLANKLINE>189 <BLANKLINE>
194 Failed export request included:190 Failed export request included:
195 * evolution-2.2 in Evolution trunk191 * evolution-2.2 in Evolution trunk
196 * Spanish (es) translation of evolution-2.2 in Evolution trunk192 * Spanish (es) translation of evolution-2.2 in Evolution trunk
197 <BLANKLINE>193 <BLANKLINE>
198 -- =194 --
199 Automatic message from Launchpad.net.195 Automatic message from Launchpad.net.
200 <BLANKLINE>196 <BLANKLINE>
201 ----------------------------------------197 ----------------------------------------
@@ -224,12 +220,12 @@
224 >>> len(test_emails)220 >>> len(test_emails)
225 1221 1
226222
227 >>> print_emails(notifications=test_emails)223 >>> print_emails(notifications=test_emails, decode=True)
228 From: ...224 From: ...
229 To: carlos@canonical.com225 To: carlos@canonical.com
230 Subject: Launchpad translation download: Evolution trunk -226 Subject: Launchpad translation download: Evolution trunk -
231 evolution-2.2 template227 evolution-2.2 template
232 Hello Carlos Perell=C3=B3 Mar=C3=ADn,228 Hello Carlos Perelló Marín,
233 <BLANKLINE>229 <BLANKLINE>
234 The translation files you requested from Launchpad are ready for230 The translation files you requested from Launchpad are ready for
235 download from the following location:231 download from the following location:
@@ -240,10 +236,9 @@
240 download these translations again, you will have to request236 download these translations again, you will have to request
241 them again at237 them again at
242 <BLANKLINE>238 <BLANKLINE>
243 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=239 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
244 port
245 <BLANKLINE>240 <BLANKLINE>
246 -- =241 --
247 Automatic message from Launchpad.net.242 Automatic message from Launchpad.net.
248 <BLANKLINE>243 <BLANKLINE>
249 ----------------------------------------244 ----------------------------------------
@@ -294,12 +289,12 @@
294289
295The confirmation email shows no errors at all.290The confirmation email shows no errors at all.
296291
297 >>> print_emails(notifications=test_emails)292 >>> print_emails(notifications=test_emails, decode=True)
298 From: ...293 From: ...
299 To: carlos@canonical.com294 To: carlos@canonical.com
300 Subject: Launchpad translation download: Evolution trunk -295 Subject: Launchpad translation download: Evolution trunk -
301 evolution-2.2 template296 evolution-2.2 template
302 Hello Carlos Perell=C3=B3 Mar=C3=ADn,297 Hello Carlos Perelló Marín,
303 <BLANKLINE>298 <BLANKLINE>
304 The translation files you requested from Launchpad are ready for299 The translation files you requested from Launchpad are ready for
305 download from the following location:300 download from the following location:
@@ -310,10 +305,9 @@
310 download these translations again, you will have to request305 download these translations again, you will have to request
311 them again at306 them again at
312 <BLANKLINE>307 <BLANKLINE>
313 http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=308 http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
314 port
315 <BLANKLINE>309 <BLANKLINE>
316 -- =310 --
317 Automatic message from Launchpad.net.311 Automatic message from Launchpad.net.
318 <BLANKLINE>312 <BLANKLINE>
319 ----------------------------------------313 ----------------------------------------
320314
=== modified file 'lib/lp/translations/doc/poexport-request.txt'
--- lib/lp/translations/doc/poexport-request.txt 2018-06-02 13:37:18 +0000
+++ lib/lp/translations/doc/poexport-request.txt 2019-05-15 08:02:45 +0000
@@ -182,7 +182,7 @@
182 >>> emails = pop_notifications()182 >>> emails = pop_notifications()
183 >>> len(emails)183 >>> len(emails)
184 1184 1
185 >>> print_emails(notifications=emails)185 >>> print_emails(notifications=emails, decode=True)
186 From: ...186 From: ...
187 To: downloader@example.com187 To: downloader@example.com
188 Subject: Launchpad translation download: Ubuntu Hoary pmount - Czech188 Subject: Launchpad translation download: Ubuntu Hoary pmount - Czech
@@ -198,10 +198,9 @@
198 download these translations again, you will have to request198 download these translations again, you will have to request
199 them again at199 them again at
200 <BLANKLINE>200 <BLANKLINE>
201 http://translations.launchpad.../pmount/+pots/pmoun=201 http://translations.launchpad.../pmount/+pots/pmount/cs/+export
202 t/cs/+export
203 <BLANKLINE>202 <BLANKLINE>
204 -- =203 --
205 Automatic message from Launchpad.net.204 Automatic message from Launchpad.net.
206 ----------------------------------------205 ----------------------------------------
207206