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
1=== modified file 'lib/lp/code/stories/branches/xx-branch-edit.txt'
2--- lib/lp/code/stories/branches/xx-branch-edit.txt 2018-05-13 10:35:52 +0000
3+++ lib/lp/code/stories/branches/xx-branch-edit.txt 2019-05-15 08:02:45 +0000
4@@ -276,11 +276,11 @@
5 >>> len(stub.test_emails)
6 1
7
8- >>> print(stub.test_emails[0][2])
9- Content-Type: ...
10- ...
11+ >>> from lp.testing.mail_helpers import print_emails
12+
13+ >>> print_emails(decode=True)
14+ From: No Privileges Person <no-priv@canonical.com>
15 To: Sample Person <test@canonical.com>
16- From: No Privileges Person <no-priv@canonical.com>
17 Subject: [Branch ~name12/foogoo/foogoo-svn]
18 ...
19 New whiteboard value
20@@ -290,9 +290,10 @@
21 http://code.launchpad.dev/~name12/foogoo/foogoo-svn
22 <BLANKLINE>
23 You are subscribed to branch lp://dev/~name12/foogoo/foogoo-svn.
24- To unsubscribe from this branch go to http://code.l.../~name12/foo=
25- goo/foogoo-svn/+edit-subscription
26+ To unsubscribe from this branch go to
27+ http://code.l.../~name12/foogoo/foogoo-svn/+edit-subscription
28 <BLANKLINE>
29+ ----------------------------------------
30
31
32 Changing the branch owner
33
34=== modified file 'lib/lp/soyuz/doc/build-failedtoupload-workflow.txt'
35--- lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2019-01-05 09:21:54 +0000
36+++ lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2019-05-15 08:02:45 +0000
37@@ -78,7 +78,7 @@
38 >>> build_notification['X-Creator-Recipient']
39 'mark@example.com'
40
41- >>> notification_body = build_notification.get_payload()
42+ >>> notification_body = build_notification.get_payload(decode=True)
43 >>> print(notification_body) #doctest: -NORMALIZE_WHITESPACE
44 <BLANKLINE>
45 * Source Package: cdrkit
46@@ -88,8 +88,7 @@
47 * Component: main
48 * State: Failed to upload
49 * Duration: 1 minute
50- * Build Log: http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22/+fil=
51- es/netapplet-1.0.0.tar.gz
52+ * Build Log: http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22/+files/netapplet-1.0.0.tar.gz
53 * Builder: http://launchpad.dev/builders/bob
54 * Source: http://launchpad.dev/ubuntu/+source/cdrkit/1.0
55 <BLANKLINE>
56@@ -100,8 +99,7 @@
57 contact us by asking a question on Launchpad
58 (https://answers.launchpad.net/launchpad/+addquestion).
59 <BLANKLINE>
60- -- =
61- <BLANKLINE>
62+ --
63 i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE
64 http://launchpad.dev/ubuntu/+source/cdrkit/1.0/+build/22
65 <BLANKLINE>
66
67=== modified file 'lib/lp/testing/mail_helpers.py'
68--- lib/lp/testing/mail_helpers.py 2015-09-14 14:12:58 +0000
69+++ lib/lp/testing/mail_helpers.py 2019-05-15 08:02:45 +0000
70@@ -1,4 +1,4 @@
71-# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
72+# Copyright 2009-2019 Canonical Ltd. This software is licensed under the
73 # GNU Affero General Public License version 3 (see the file LICENSE).
74
75 """Helper functions dealing with emails in tests.
76@@ -60,7 +60,8 @@
77
78 def print_emails(include_reply_to=False, group_similar=False,
79 include_rationale=False, include_for=False,
80- notifications=None, include_notification_type=False):
81+ notifications=None, include_notification_type=False,
82+ decode=False):
83 """Pop all messages from stub.test_emails and print them with
84 their recipients.
85
86@@ -80,6 +81,7 @@
87 the stack.
88 :param include_notification_type: Include the
89 X-Launchpad-Notification-Type header.
90+ :param decode: Decode message payloads if True.
91 """
92 distinct_bodies = {}
93 if notifications is None:
94@@ -88,7 +90,7 @@
95 recipients = set(
96 recipient.strip()
97 for recipient in message['To'].split(','))
98- body = message.get_payload()
99+ body = message.get_payload(decode=decode)
100 if group_similar:
101 # Strip the first line as it's different for each recipient.
102 body = body[body.find('\n') + 1:]
103
104=== modified file 'lib/lp/translations/doc/poexport-queue.txt'
105--- lib/lp/translations/doc/poexport-queue.txt 2018-06-02 13:37:18 +0000
106+++ lib/lp/translations/doc/poexport-queue.txt 2019-05-15 08:02:45 +0000
107@@ -74,12 +74,12 @@
108
109 One is for the user with the error notification.
110
111- >>> print_emails(notifications=[carlos_email])
112+ >>> print_emails(notifications=[carlos_email], decode=True)
113 From: ...
114 To: carlos@canonical.com
115 Subject: Launchpad translation download: Evolution trunk -
116 evolution-2.2 template
117- Hello Carlos Perell=C3=B3 Mar=C3=ADn,
118+ Hello Carlos Perelló Marín,
119 <BLANKLINE>
120 Launchpad encountered problems exporting the files you requested.
121 The Launchpad Translations team has been notified of this problem.
122@@ -87,10 +87,9 @@
123 <BLANKLINE>
124 If you want to retry your request, you can do so at
125 <BLANKLINE>
126- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
127- port.
128+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export.
129 <BLANKLINE>
130- -- =
131+ --
132 Automatic message from Launchpad.net.
133 <BLANKLINE>
134 ----------------------------------------
135@@ -98,7 +97,7 @@
136 And the other to the admins. This one lists the files that were being
137 exported as context to help tracking down any bugs.
138
139- >>> print_emails(notifications=[admin_email])
140+ >>> print_emails(notifications=[admin_email], decode=True)
141 From: ...
142 To: launchpad-error-reports@lists.canonical.com
143 Subject: Launchpad translation download errors: Evolution trunk -
144@@ -106,10 +105,9 @@
145 Hello Launchpad administrators,
146 <BLANKLINE>
147 Launchpad encountered problems exporting translation files
148- requested by Carlos Perell=C3=B3 Mar=C3=ADn (carlos) at
149+ requested by Carlos Perelló Marín (carlos) at
150 <BLANKLINE>
151- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
152- port
153+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
154 <BLANKLINE>
155 This means we have a bug in Launchpad that needs to be fixed
156 before this export can proceed. Here is the error we got:
157@@ -123,7 +121,7 @@
158 * evolution-2.2 in Evolution trunk
159 * Spanish (es) translation of evolution-2.2 in Evolution trunk
160 <BLANKLINE>
161- -- =
162+ --
163 Automatic message from Launchpad.net.
164 <BLANKLINE>
165 ----------------------------------------
166@@ -153,12 +151,12 @@
167 The user's notification looks no different from that for an ordinary
168 error.
169
170- >>> print_emails(notifications=[carlos_email])
171+ >>> print_emails(notifications=[carlos_email], decode=True)
172 From: ...
173 To: carlos@canonical.com
174 Subject: Launchpad translation download: Evolution trunk -
175 evolution-2.2 template
176- Hello Carlos Perell=C3=B3 Mar=C3=ADn,
177+ Hello Carlos Perelló Marín,
178 <BLANKLINE>
179 Launchpad encountered problems exporting the files you requested.
180 The Launchpad Translations team has been notified of this problem.
181@@ -166,10 +164,9 @@
182 <BLANKLINE>
183 If you want to retry your request, you can do so at
184 <BLANKLINE>
185- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
186- port.
187+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export.
188 <BLANKLINE>
189- -- =
190+ --
191 Automatic message from Launchpad.net.
192 <BLANKLINE>
193 ----------------------------------------
194@@ -177,7 +174,7 @@
195 The one for the administrators, however, does not include the
196 unprintable exception text.
197
198- >>> print_emails(notifications=[admin_email])
199+ >>> print_emails(notifications=[admin_email], decode=True)
200 From: ...
201 To: launchpad-error-reports@lists.canonical.com
202 Subject: Launchpad translation download errors: Evolution trunk -
203@@ -188,14 +185,13 @@
204 failure during a translation export requested by Carlos ...
205 (carlos) at
206 <BLANKLINE>
207- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
208- port
209+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
210 <BLANKLINE>
211 Failed export request included:
212 * evolution-2.2 in Evolution trunk
213 * Spanish (es) translation of evolution-2.2 in Evolution trunk
214 <BLANKLINE>
215- -- =
216+ --
217 Automatic message from Launchpad.net.
218 <BLANKLINE>
219 ----------------------------------------
220@@ -224,12 +220,12 @@
221 >>> len(test_emails)
222 1
223
224- >>> print_emails(notifications=test_emails)
225+ >>> print_emails(notifications=test_emails, decode=True)
226 From: ...
227 To: carlos@canonical.com
228 Subject: Launchpad translation download: Evolution trunk -
229 evolution-2.2 template
230- Hello Carlos Perell=C3=B3 Mar=C3=ADn,
231+ Hello Carlos Perelló Marín,
232 <BLANKLINE>
233 The translation files you requested from Launchpad are ready for
234 download from the following location:
235@@ -240,10 +236,9 @@
236 download these translations again, you will have to request
237 them again at
238 <BLANKLINE>
239- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
240- port
241+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
242 <BLANKLINE>
243- -- =
244+ --
245 Automatic message from Launchpad.net.
246 <BLANKLINE>
247 ----------------------------------------
248@@ -294,12 +289,12 @@
249
250 The confirmation email shows no errors at all.
251
252- >>> print_emails(notifications=test_emails)
253+ >>> print_emails(notifications=test_emails, decode=True)
254 From: ...
255 To: carlos@canonical.com
256 Subject: Launchpad translation download: Evolution trunk -
257 evolution-2.2 template
258- Hello Carlos Perell=C3=B3 Mar=C3=ADn,
259+ Hello Carlos Perelló Marín,
260 <BLANKLINE>
261 The translation files you requested from Launchpad are ready for
262 download from the following location:
263@@ -310,10 +305,9 @@
264 download these translations again, you will have to request
265 them again at
266 <BLANKLINE>
267- http://translations.launchpad.../trunk/+pots/evolution-2.2/+ex=
268- port
269+ http://translations.launchpad.../trunk/+pots/evolution-2.2/+export
270 <BLANKLINE>
271- -- =
272+ --
273 Automatic message from Launchpad.net.
274 <BLANKLINE>
275 ----------------------------------------
276
277=== modified file 'lib/lp/translations/doc/poexport-request.txt'
278--- lib/lp/translations/doc/poexport-request.txt 2018-06-02 13:37:18 +0000
279+++ lib/lp/translations/doc/poexport-request.txt 2019-05-15 08:02:45 +0000
280@@ -182,7 +182,7 @@
281 >>> emails = pop_notifications()
282 >>> len(emails)
283 1
284- >>> print_emails(notifications=emails)
285+ >>> print_emails(notifications=emails, decode=True)
286 From: ...
287 To: downloader@example.com
288 Subject: Launchpad translation download: Ubuntu Hoary pmount - Czech
289@@ -198,10 +198,9 @@
290 download these translations again, you will have to request
291 them again at
292 <BLANKLINE>
293- http://translations.launchpad.../pmount/+pots/pmoun=
294- t/cs/+export
295+ http://translations.launchpad.../pmount/+pots/pmount/cs/+export
296 <BLANKLINE>
297- -- =
298+ --
299 Automatic message from Launchpad.net.
300 ----------------------------------------
301