Merge ~cjwatson/launchpad:lazr.restful-1.0.3 into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 741436381be4f6a9a9b4003492c6a02a0a67069b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:lazr.restful-1.0.3
Merge into: launchpad:master
Diff against target: 239 lines (+93/-86)
3 files modified
lib/lp/registry/stories/webservice/xx-distribution-source-package.txt (+21/-17)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+71/-68)
requirements/launchpad.txt (+1/-1)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+403092@code.launchpad.net

Commit message

Upgrade to lazr.restful 1.0.3

Description of the change

We need to adjust a couple of doctests slightly to cope with `WebServiceResponseWrapper.jsonBody` now turning JSON objects into OrderedDicts.

Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/403091

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt b/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
2index 9711784..87b314a 100644
3--- a/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
4+++ b/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
5@@ -3,25 +3,26 @@ Distribution Source Packages
6
7 Source packages can be obtained from the context of a distribution.
8
9+ >>> from lazr.restful.testing.webservice import pprint_entry
10+
11 >>> debian = webservice.get('/debian').jsonBody()
12
13 >>> mozilla_firefox = webservice.named_get(
14 ... debian['self_link'], 'getSourcePackage',
15 ... name='mozilla-firefox').jsonBody()
16
17- >>> print(pretty(mozilla_firefox))
18- {'bug_reported_acknowledgement': None,
19- 'bug_reporting_guidelines': None,
20- 'display_name': 'mozilla-firefox in Debian',
21- 'distribution_link': 'http://.../debian',
22- 'http_etag': '...',
23- 'name': 'mozilla-firefox',
24- 'official_bug_tags': [],
25- 'resource_type_link': 'http://.../#distribution_source_package',
26- 'self_link': 'http://.../debian/+source/mozilla-firefox',
27- 'title': 'mozilla-firefox package in Debian',
28- 'upstream_product_link': None,
29- 'web_link': 'http://launchpad.../debian/+source/mozilla-firefox'}
30+ >>> pprint_entry(mozilla_firefox)
31+ bug_reported_acknowledgement: None
32+ bug_reporting_guidelines: None
33+ display_name: 'mozilla-firefox in Debian'
34+ distribution_link: 'http://.../debian'
35+ name: 'mozilla-firefox'
36+ official_bug_tags: []
37+ resource_type_link: 'http://.../#distribution_source_package'
38+ self_link: 'http://.../debian/+source/mozilla-firefox'
39+ title: 'mozilla-firefox package in Debian'
40+ upstream_product_link: None
41+ web_link: 'http://launchpad.../debian/+source/mozilla-firefox'
42
43 It's also possible to search for tasks with the "searchTasks" method:
44
45@@ -51,10 +52,13 @@ package.
46 >>> upstream_product = webservice.get(
47 ... ubuntu_firefox['upstream_product_link']).jsonBody()
48
49- >>> print(pretty(upstream_product))
50- {...
51- 'display_name': 'Mozilla Firefox'...
52- 'self_link': 'http://.../firefox'...}
53+ >>> pprint_entry(upstream_product)
54+ active: True
55+ ...
56+ display_name: 'Mozilla Firefox'
57+ ...
58+ self_link: 'http://.../firefox'
59+ ...
60
61 If the package isn't linked to an upstream product its
62 upstream_product_link will be None.
63diff --git a/lib/lp/registry/stories/webservice/xx-project-registry.txt b/lib/lp/registry/stories/webservice/xx-project-registry.txt
64index 7e2654b..f758070 100644
65--- a/lib/lp/registry/stories/webservice/xx-project-registry.txt
66+++ b/lib/lp/registry/stories/webservice/xx-project-registry.txt
67@@ -59,7 +59,10 @@ Project group entry
68 Project groups are available at their canonical URL on the API virtual
69 host.
70
71- >>> from lazr.restful.testing.webservice import pprint_entry
72+ >>> from lazr.restful.testing.webservice import (
73+ ... pprint_collection,
74+ ... pprint_entry,
75+ ... )
76
77 >>> mozilla = webservice.get('/mozilla').jsonBody()
78 >>> pprint_entry(mozilla)
79@@ -447,62 +450,63 @@ hierarchy of series, milestones, and releases.
80 ... firefox['self_link'],
81 ... "get_timeline",
82 ... include_inactive=True).jsonBody()
83- >>> print(pretty(timeline))
84- {'entries': [{'http_etag': ...
85- 'is_development_focus': True,
86- 'landmarks': [{'code_name': None,
87- 'date': '2056-10-16',
88- 'name': '1.0',
89- 'type': 'milestone',
90- 'uri': '/firefox/+milestone/1.0'},
91- {'code_name': 'One (secure) Tree Hill',
92- 'date': '2004-10-15',
93- 'name': '0.9.2',
94- 'type': 'release',
95- 'uri': '/firefox/trunk/0.9.2'},
96- {'code_name': 'One Tree Hill (v2)',
97- 'date': '2004-10-15',
98- 'name': '0.9.1',
99- 'type': 'release',
100- 'uri': '/firefox/trunk/0.9.1'},
101- {'code_name': 'One Tree Hill',
102- 'date': '2004-10-15',
103- 'name': '0.9',
104- 'type': 'release',
105- 'uri': '/firefox/trunk/0.9'}],
106- 'name': 'trunk',
107- 'project_link': 'http://.../firefox',
108- 'resource_type_link': '.../#timeline_project_series',
109- 'self_link': 'http://.../firefox/trunk',
110- 'status': 'Obsolete',
111- 'uri': '/firefox/trunk',
112- 'web_link': 'http://launchpad.../firefox/trunk'},
113- {'http_etag': ...
114- 'is_development_focus': False,
115- 'landmarks': [{'code_name': 'First Stable Release',
116- 'date': '2004-06-28',
117- 'name': '1.0.0',
118- 'type': 'release',
119- 'uri': '/firefox/1.0/1.0.0'}],
120- 'name': '1.0',
121- 'project_link': 'http://.../firefox',
122- 'resource_type_link': '.../#timeline_project_series',
123- 'self_link': 'http://.../firefox/1.0',
124- 'status': 'Active Development',
125- 'uri': '/firefox/1.0',
126- 'web_link': 'http://launchpad.../firefox/1.0'},
127- {'http_etag': ...
128- 'is_development_focus': False,
129- 'landmarks': [],
130- 'name': 'experimental',
131- 'project_link': 'http://.../firefox',
132- 'resource_type_link': '.../#timeline_project_series',
133- 'self_link': 'http://.../firefox/experimental',
134- 'status': 'Active Development',
135- 'uri': '/firefox/experimental',
136- 'web_link': 'http://launchpad.../firefox/experimental'}],
137- 'start': 0,
138- 'total_size': 3}
139+ >>> pprint_collection(timeline)
140+ start: 0
141+ total_size: 3
142+ ---
143+ is_development_focus: True
144+ landmarks: [{'code_name': None,
145+ 'date': '2056-10-16',
146+ 'name': '1.0',
147+ 'type': 'milestone',
148+ 'uri': '/firefox/+milestone/1.0'},
149+ {'code_name': 'One (secure) Tree Hill',
150+ 'date': '2004-10-15',
151+ 'name': '0.9.2',
152+ 'type': 'release',
153+ 'uri': '/firefox/trunk/0.9.2'},
154+ {'code_name': 'One Tree Hill (v2)',
155+ 'date': '2004-10-15',
156+ 'name': '0.9.1',
157+ 'type': 'release',
158+ 'uri': '/firefox/trunk/0.9.1'},
159+ {'code_name': 'One Tree Hill',
160+ 'date': '2004-10-15',
161+ 'name': '0.9',
162+ 'type': 'release',
163+ 'uri': '/firefox/trunk/0.9'}]
164+ name: 'trunk'
165+ project_link: 'http://.../firefox'
166+ resource_type_link: '.../#timeline_project_series'
167+ self_link: 'http://.../firefox/trunk'
168+ status: 'Obsolete'
169+ uri: '/firefox/trunk'
170+ web_link: 'http://launchpad.../firefox/trunk'
171+ ---
172+ is_development_focus: False
173+ landmarks: [{'code_name': 'First Stable Release',
174+ 'date': '2004-06-28',
175+ 'name': '1.0.0',
176+ 'type': 'release',
177+ 'uri': '/firefox/1.0/1.0.0'}]
178+ name: '1.0'
179+ project_link: 'http://.../firefox'
180+ resource_type_link: '.../#timeline_project_series'
181+ self_link: 'http://.../firefox/1.0'
182+ status: 'Active Development'
183+ uri: '/firefox/1.0'
184+ web_link: 'http://launchpad.../firefox/1.0'
185+ ---
186+ is_development_focus: False
187+ landmarks: []
188+ name: 'experimental'
189+ project_link: 'http://.../firefox'
190+ resource_type_link: '.../#timeline_project_series'
191+ self_link: 'http://.../firefox/experimental'
192+ status: 'Active Development'
193+ uri: '/firefox/experimental'
194+ web_link: 'http://launchpad.../firefox/experimental'
195+ ---
196
197
198 Project collection
199@@ -758,17 +762,16 @@ milestones and releases.
200
201 >>> timeline = webservice.named_get(
202 ... babadoo_foobadoo['self_link'], "get_timeline").jsonBody()
203- >>> print(pretty(timeline))
204- {'http_etag': ...
205- 'is_development_focus': False,
206- 'landmarks': [],
207- 'name': 'foobadoo',
208- 'project_link': 'http://.../babadoo',
209- 'resource_type_link': 'http://.../#timeline_project_series',
210- 'self_link': 'http://.../babadoo/foobadoo',
211- 'status': 'Active Development',
212- 'uri': '/babadoo/foobadoo',
213- 'web_link': 'http://launchpad.../babadoo/foobadoo'}
214+ >>> pprint_entry(timeline)
215+ is_development_focus: False
216+ landmarks: []
217+ name: 'foobadoo'
218+ project_link: 'http://.../babadoo'
219+ resource_type_link: 'http://.../#timeline_project_series'
220+ self_link: 'http://.../babadoo/foobadoo'
221+ status: 'Active Development'
222+ uri: '/babadoo/foobadoo'
223+ web_link: 'http://launchpad.../babadoo/foobadoo'
224
225
226 Creating a milestone on the product series
227diff --git a/requirements/launchpad.txt b/requirements/launchpad.txt
228index 43df834..23efe17 100644
229--- a/requirements/launchpad.txt
230+++ b/requirements/launchpad.txt
231@@ -72,7 +72,7 @@ lazr.delegates==2.0.4
232 lazr.enum==1.2
233 lazr.jobrunner==0.17
234 lazr.lifecycle==1.2
235-lazr.restful==1.0.2
236+lazr.restful==1.0.3
237 lazr.restfulclient==0.14.3
238 lazr.sshserver==0.1.11
239 lazr.uri==1.0.5

Subscribers

People subscribed via source and target branches

to status/vote changes: