Merge ~cjwatson/launchpad:py3-blueprints-doctest-unicode-strings into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 809a15fdebf4bb8a2ce1c23695a2cd6da1fa2d55
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-blueprints-doctest-unicode-strings
Merge into: launchpad:master
Diff against target: 188 lines (+41/-32)
7 files modified
lib/lp/blueprints/browser/tests/sprintattendance-views.txt (+3/-2)
lib/lp/blueprints/doc/specgraph.txt (+2/-2)
lib/lp/blueprints/doc/specification-notifications.txt (+8/-8)
lib/lp/blueprints/doc/specification.txt (+9/-8)
lib/lp/blueprints/doc/specificationmessage.txt (+4/-4)
lib/lp/blueprints/doc/sprint-meeting-export.txt (+10/-6)
lib/lp/blueprints/stories/sprints/xx-sprints.txt (+5/-2)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+396824@code.launchpad.net

Commit message

lp.blueprints: Fix u'...' doctest examples for Python 3

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/blueprints/browser/tests/sprintattendance-views.txt b/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
index ea15513..98f835a 100644
--- a/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
+++ b/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
@@ -88,8 +88,9 @@ you wanted the meeting's start and end dates respectively.
88Sample Person is now listed as an attendee.88Sample Person is now listed as an attendee.
8989
90 >>> ubz = getUtility(ISprintSet)['ubz']90 >>> ubz = getUtility(ISprintSet)['ubz']
91 >>> [attendee.name for attendee in ubz.attendees]91 >>> for attendee in ubz.attendees:
92 [u'name12']92 ... print(attendee.name)
93 name12
9394
94 >>> sprint_attendance = ubz.attendances[0]95 >>> sprint_attendance = ubz.attendances[0]
9596
diff --git a/lib/lp/blueprints/doc/specgraph.txt b/lib/lp/blueprints/doc/specgraph.txt
index 86d678a..3a57d6e 100644
--- a/lib/lp/blueprints/doc/specgraph.txt
+++ b/lib/lp/blueprints/doc/specgraph.txt
@@ -281,8 +281,8 @@ The SpecificationTreeImageTag view is indirectly called when the spec's
281 >>> page_view.initialize()281 >>> page_view.initialize()
282 >>> content = page_view.render()282 >>> content = page_view.render()
283 >>> image_start = content.find('<map id="deptree"')283 >>> image_start = content.find('<map id="deptree"')
284 >>> content[image_start:image_start + 33]284 >>> print(content[image_start:image_start + 33])
285 u'<map id="deptree" name="deptree">'285 <map id="deptree" name="deptree">
286286
287287
288renderGraphvizGraph() error handling288renderGraphvizGraph() error handling
diff --git a/lib/lp/blueprints/doc/specification-notifications.txt b/lib/lp/blueprints/doc/specification-notifications.txt
index 06c387e..097cf25 100644
--- a/lib/lp/blueprints/doc/specification-notifications.txt
+++ b/lib/lp/blueprints/doc/specification-notifications.txt
@@ -40,14 +40,14 @@ the approver, Cprov, and the drafter, Robert.
40 ... subscription.person for subscription in svg_support.subscriptions]40 ... subscription.person for subscription in svg_support.subscriptions]
41 >>> related_people_addresses = [41 >>> related_people_addresses = [
42 ... [person.preferredemail.email] for person in set(related_people)]42 ... [person.preferredemail.email] for person in set(related_people)]
43 >>> for addr in sorted(related_people_addresses): print(addr)43 >>> for addr in sorted(related_people_addresses): print(pretty(addr))
44 [u'andrew.bennetts@ubuntulinux.com']44 ['andrew.bennetts@ubuntulinux.com']
45 [u'carlos@canonical.com']45 ['carlos@canonical.com']
46 [u'celso.providelo@canonical.com']46 ['celso.providelo@canonical.com']
47 [u'daf@canonical.com']47 ['daf@canonical.com']
48 [u'foo.bar@canonical.com']48 ['foo.bar@canonical.com']
49 [u'robertc@robertcollins.net']49 ['robertc@robertcollins.net']
50 [u'stuart.bishop@canonical.com']50 ['stuart.bishop@canonical.com']
5151
52 >>> sent_addresses = sorted(52 >>> sent_addresses = sorted(
53 ... [to_addrs for from_addr, to_addrs, message in stub.test_emails])53 ... [to_addrs for from_addr, to_addrs, message in stub.test_emails])
diff --git a/lib/lp/blueprints/doc/specification.txt b/lib/lp/blueprints/doc/specification.txt
index 92d8382..47b6121 100644
--- a/lib/lp/blueprints/doc/specification.txt
+++ b/lib/lp/blueprints/doc/specification.txt
@@ -38,8 +38,8 @@ To retrieve a specification by its ID, we use `ISpecificationSet.get`.
3838
39It should be possible to retrieve a specification by its name39It should be possible to retrieve a specification by its name
4040
41 >>> upstream_firefox.getSpecification('mng').name41 >>> print(upstream_firefox.getSpecification('mng').name)
42 u'mng'42 mng
4343
44And if we try to retrieve a non-existent specification we should get44And if we try to retrieve a non-existent specification we should get
45None45None
@@ -49,8 +49,9 @@ None
4949
50It's also possible to retrieve a specification by its URL50It's also possible to retrieve a specification by its URL
5151
52 >>> specset.getByURL('http://developer.mozilla.org/en/docs/SVG').specurl52 >>> print(specset.getByURL(
53 u'http://developer.mozilla.org/en/docs/SVG'53 ... 'http://developer.mozilla.org/en/docs/SVG').specurl)
54 http://developer.mozilla.org/en/docs/SVG
5455
55And if there's no specification with the given URL we should get None56And if there's no specification with the given URL we should get None
5657
@@ -392,8 +393,8 @@ when we do.
392 >>> e4x.goal is not None393 >>> e4x.goal is not None
393 True394 True
394395
395 >>> e4x.goal_proposer.name396 >>> print(e4x.goal_proposer.name)
396 u'jdub'397 jdub
397398
398 >>> e4x.date_goal_proposed is not None399 >>> e4x.date_goal_proposed is not None
399 True400 True
@@ -415,8 +416,8 @@ We can then accept the goal.
415 >>> e4x.goalstatus.title416 >>> e4x.goalstatus.title
416 'Accepted'417 'Accepted'
417418
418 >>> e4x.goal_decider.name419 >>> print(e4x.goal_decider.name)
419 u'mark'420 mark
420421
421 >>> e4x.date_goal_decided is not None422 >>> e4x.date_goal_decided is not None
422 True423 True
diff --git a/lib/lp/blueprints/doc/specificationmessage.txt b/lib/lp/blueprints/doc/specificationmessage.txt
index cbeaa9e..d5d944f 100644
--- a/lib/lp/blueprints/doc/specificationmessage.txt
+++ b/lib/lp/blueprints/doc/specificationmessage.txt
@@ -21,8 +21,8 @@ ISpecificationMessageSet.createMessage:
21 ... content="text message content",21 ... content="text message content",
22 ... owner=factory.makePerson(),22 ... owner=factory.makePerson(),
23 ... spec=factory.makeSpecification())23 ... spec=factory.makeSpecification())
24 >>> test_message.message.subject24 >>> print(test_message.message.subject)
25 u'test message subject'25 test message subject
2626
2727
28Retrieving specification messages28Retrieving specification messages
@@ -35,5 +35,5 @@ ISpecificationMessageSet.get:
35 >>> from zope.security.proxy import removeSecurityProxy35 >>> from zope.security.proxy import removeSecurityProxy
36 >>> specmessage_one = specmessageset.get(36 >>> specmessage_one = specmessageset.get(
37 ... removeSecurityProxy(test_message).id)37 ... removeSecurityProxy(test_message).id)
38 >>> specmessage_one.message.subject38 >>> print(specmessage_one.message.subject)
39 u'test message subject'39 test message subject
diff --git a/lib/lp/blueprints/doc/sprint-meeting-export.txt b/lib/lp/blueprints/doc/sprint-meeting-export.txt
index ea315da..51cc5b3 100644
--- a/lib/lp/blueprints/doc/sprint-meeting-export.txt
+++ b/lib/lp/blueprints/doc/sprint-meeting-export.txt
@@ -74,9 +74,11 @@ The person does not show up as interested in the spec though. Only the
74specification assignee is listed (the drafter would be too if one was74specification assignee is listed (the drafter would be too if one was
75assigned).75assigned).
7676
77 >>> sorted(person['name']77 >>> from operator import itemgetter
78 ... for person in view.specifications[1]['interested'])78 >>> for person in sorted(
79 [u'carlos']79 ... view.specifications[1]['interested'], key=itemgetter('name')):
80 ... print(person['name'])
81 carlos
8082
81This is because sample person has not registered as an attendee of the83This is because sample person has not registered as an attendee of the
82sprint. If we add them as an attendee, then they will be available:84sprint. If we add them as an attendee, then they will be available:
@@ -91,9 +93,11 @@ sprint. If we add them as an attendee, then they will be available:
91 >>> login(ANONYMOUS)93 >>> login(ANONYMOUS)
92 >>> view = getMultiAdapter((ubz, request), name='+temp-meeting-export')94 >>> view = getMultiAdapter((ubz, request), name='+temp-meeting-export')
93 >>> view.initialize()95 >>> view.initialize()
94 >>> sorted(person['name']96 >>> for person in sorted(
95 ... for person in view.specifications[1]['interested'])97 ... view.specifications[1]['interested'], key=itemgetter('name')):
96 [u'carlos', u'name12']98 ... print(person['name'])
99 carlos
100 name12
97101
98The person is also included in the list of attendees:102The person is also included in the list of attendees:
99103
diff --git a/lib/lp/blueprints/stories/sprints/xx-sprints.txt b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
index bd0e5c9..5203299 100644
--- a/lib/lp/blueprints/stories/sprints/xx-sprints.txt
+++ b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
@@ -450,6 +450,7 @@ drivers, owners, and admins.
450450
451First, we add a couple of IRC nicknames for Carlos.451First, we add a couple of IRC nicknames for Carlos.
452452
453 >>> from operator import attrgetter
453 >>> from lp.testing import login, logout454 >>> from lp.testing import login, logout
454 >>> from zope.component import getUtility455 >>> from zope.component import getUtility
455 >>> from lp.registry.interfaces.person import IPersonSet456 >>> from lp.registry.interfaces.person import IPersonSet
@@ -462,8 +463,10 @@ First, we add a couple of IRC nicknames for Carlos.
462 >>> IrcID(person=carlos, network='QuakeNet', nickname='qarlos')463 >>> IrcID(person=carlos, network='QuakeNet', nickname='qarlos')
463 <IrcID at ...>464 <IrcID at ...>
464465
465 >>> sorted([ircid.nickname for ircid in carlos.ircnicknames])466 >>> for ircid in sorted(carlos.ircnicknames, key=attrgetter('nickname')):
466 [u'carlos', u'qarlos']467 ... print(ircid.nickname)
468 carlos
469 qarlos
467470
468 >>> logout()471 >>> logout()
469472

Subscribers

People subscribed via source and target branches

to status/vote changes: