← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging ~cjwatson/launchpad:lazr.restful-1.0.3 into launchpad:master.

Commit message:
Upgrade to lazr.restful 1.0.3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1928474 in Launchpad itself: "Lists of strings result in inconsistent ETags between Python 2 and 3"
  https://bugs.launchpad.net/launchpad/+bug/1928474

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/403092

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
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:lazr.restful-1.0.3 into launchpad:master.
diff --git a/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt b/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
index 9711784..87b314a 100644
--- a/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
+++ b/lib/lp/registry/stories/webservice/xx-distribution-source-package.txt
@@ -3,25 +3,26 @@ Distribution Source Packages
 
 Source packages can be obtained from the context of a distribution.
 
+    >>> from lazr.restful.testing.webservice import pprint_entry
+
     >>> debian = webservice.get('/debian').jsonBody()
 
     >>> mozilla_firefox = webservice.named_get(
     ...     debian['self_link'], 'getSourcePackage',
     ...     name='mozilla-firefox').jsonBody()
 
-    >>> print(pretty(mozilla_firefox))
-    {'bug_reported_acknowledgement': None,
-     'bug_reporting_guidelines': None,
-     'display_name': 'mozilla-firefox in Debian',
-     'distribution_link': 'http://.../debian',
-     'http_etag': '...',
-     'name': 'mozilla-firefox',
-     'official_bug_tags': [],
-     'resource_type_link': 'http://.../#distribution_source_package',
-     'self_link': 'http://.../debian/+source/mozilla-firefox',
-     'title': 'mozilla-firefox package in Debian',
-     'upstream_product_link': None,
-     'web_link': 'http://launchpad.../debian/+source/mozilla-firefox'}
+    >>> pprint_entry(mozilla_firefox)
+    bug_reported_acknowledgement: None
+    bug_reporting_guidelines: None
+    display_name: 'mozilla-firefox in Debian'
+    distribution_link: 'http://.../debian'
+    name: 'mozilla-firefox'
+    official_bug_tags: []
+    resource_type_link: 'http://.../#distribution_source_package'
+    self_link: 'http://.../debian/+source/mozilla-firefox'
+    title: 'mozilla-firefox package in Debian'
+    upstream_product_link: None
+    web_link: 'http://launchpad.../debian/+source/mozilla-firefox'
 
 It's also possible to search for tasks with the "searchTasks" method:
 
@@ -51,10 +52,13 @@ package.
     >>> upstream_product = webservice.get(
     ...     ubuntu_firefox['upstream_product_link']).jsonBody()
 
-    >>> print(pretty(upstream_product))
-    {...
-     'display_name': 'Mozilla Firefox'...
-     'self_link': 'http://.../firefox'...}
+    >>> pprint_entry(upstream_product)
+    active: True
+    ...
+    display_name: 'Mozilla Firefox'
+    ...
+    self_link: 'http://.../firefox'
+    ...
 
 If the package isn't linked to an upstream product its
 upstream_product_link will be None.
diff --git a/lib/lp/registry/stories/webservice/xx-project-registry.txt b/lib/lp/registry/stories/webservice/xx-project-registry.txt
index 7e2654b..f758070 100644
--- a/lib/lp/registry/stories/webservice/xx-project-registry.txt
+++ b/lib/lp/registry/stories/webservice/xx-project-registry.txt
@@ -59,7 +59,10 @@ Project group entry
 Project groups are available at their canonical URL on the API virtual
 host.
 
-    >>> from lazr.restful.testing.webservice import pprint_entry
+    >>> from lazr.restful.testing.webservice import (
+    ...     pprint_collection,
+    ...     pprint_entry,
+    ...     )
 
     >>> mozilla = webservice.get('/mozilla').jsonBody()
     >>> pprint_entry(mozilla)
@@ -447,62 +450,63 @@ hierarchy of series, milestones, and releases.
     ...     firefox['self_link'],
     ...     "get_timeline",
     ...     include_inactive=True).jsonBody()
-    >>> print(pretty(timeline))
-    {'entries': [{'http_etag': ...
-                  'is_development_focus': True,
-                  'landmarks': [{'code_name': None,
-                                 'date': '2056-10-16',
-                                 'name': '1.0',
-                                 'type': 'milestone',
-                                 'uri': '/firefox/+milestone/1.0'},
-                                {'code_name': 'One (secure) Tree Hill',
-                                 'date': '2004-10-15',
-                                 'name': '0.9.2',
-                                 'type': 'release',
-                                 'uri': '/firefox/trunk/0.9.2'},
-                                {'code_name': 'One Tree Hill (v2)',
-                                 'date': '2004-10-15',
-                                 'name': '0.9.1',
-                                 'type': 'release',
-                                 'uri': '/firefox/trunk/0.9.1'},
-                                {'code_name': 'One Tree Hill',
-                                 'date': '2004-10-15',
-                                 'name': '0.9',
-                                 'type': 'release',
-                                 'uri': '/firefox/trunk/0.9'}],
-                  'name': 'trunk',
-                  'project_link': 'http://.../firefox',
-                  'resource_type_link': '.../#timeline_project_series',
-                  'self_link': 'http://.../firefox/trunk',
-                  'status': 'Obsolete',
-                  'uri': '/firefox/trunk',
-                  'web_link': 'http://launchpad.../firefox/trunk'},
-                 {'http_etag': ...
-                  'is_development_focus': False,
-                  'landmarks': [{'code_name': 'First Stable Release',
-                                 'date': '2004-06-28',
-                                 'name': '1.0.0',
-                                 'type': 'release',
-                                 'uri': '/firefox/1.0/1.0.0'}],
-                  'name': '1.0',
-                  'project_link': 'http://.../firefox',
-                  'resource_type_link': '.../#timeline_project_series',
-                  'self_link': 'http://.../firefox/1.0',
-                  'status': 'Active Development',
-                  'uri': '/firefox/1.0',
-                  'web_link': 'http://launchpad.../firefox/1.0'},
-                 {'http_etag': ...
-                  'is_development_focus': False,
-                  'landmarks': [],
-                  'name': 'experimental',
-                  'project_link': 'http://.../firefox',
-                  'resource_type_link': '.../#timeline_project_series',
-                  'self_link': 'http://.../firefox/experimental',
-                  'status': 'Active Development',
-                  'uri': '/firefox/experimental',
-                  'web_link': 'http://launchpad.../firefox/experimental'}],
-     'start': 0,
-     'total_size': 3}
+    >>> pprint_collection(timeline)
+    start: 0
+    total_size: 3
+    ---
+    is_development_focus: True
+    landmarks: [{'code_name': None,
+                 'date': '2056-10-16',
+                 'name': '1.0',
+                 'type': 'milestone',
+                 'uri': '/firefox/+milestone/1.0'},
+                {'code_name': 'One (secure) Tree Hill',
+                 'date': '2004-10-15',
+                 'name': '0.9.2',
+                 'type': 'release',
+                 'uri': '/firefox/trunk/0.9.2'},
+                {'code_name': 'One Tree Hill (v2)',
+                 'date': '2004-10-15',
+                 'name': '0.9.1',
+                 'type': 'release',
+                 'uri': '/firefox/trunk/0.9.1'},
+                {'code_name': 'One Tree Hill',
+                 'date': '2004-10-15',
+                 'name': '0.9',
+                 'type': 'release',
+                 'uri': '/firefox/trunk/0.9'}]
+    name: 'trunk'
+    project_link: 'http://.../firefox'
+    resource_type_link: '.../#timeline_project_series'
+    self_link: 'http://.../firefox/trunk'
+    status: 'Obsolete'
+    uri: '/firefox/trunk'
+    web_link: 'http://launchpad.../firefox/trunk'
+    ---
+    is_development_focus: False
+    landmarks: [{'code_name': 'First Stable Release',
+                 'date': '2004-06-28',
+                 'name': '1.0.0',
+                 'type': 'release',
+                 'uri': '/firefox/1.0/1.0.0'}]
+    name: '1.0'
+    project_link: 'http://.../firefox'
+    resource_type_link: '.../#timeline_project_series'
+    self_link: 'http://.../firefox/1.0'
+    status: 'Active Development'
+    uri: '/firefox/1.0'
+    web_link: 'http://launchpad.../firefox/1.0'
+    ---
+    is_development_focus: False
+    landmarks: []
+    name: 'experimental'
+    project_link: 'http://.../firefox'
+    resource_type_link: '.../#timeline_project_series'
+    self_link: 'http://.../firefox/experimental'
+    status: 'Active Development'
+    uri: '/firefox/experimental'
+    web_link: 'http://launchpad.../firefox/experimental'
+    ---
 
 
 Project collection
@@ -758,17 +762,16 @@ milestones and releases.
 
     >>> timeline = webservice.named_get(
     ...     babadoo_foobadoo['self_link'], "get_timeline").jsonBody()
-    >>> print(pretty(timeline))
-    {'http_etag': ...
-     'is_development_focus': False,
-     'landmarks': [],
-     'name': 'foobadoo',
-     'project_link': 'http://.../babadoo',
-     'resource_type_link': 'http://.../#timeline_project_series',
-     'self_link': 'http://.../babadoo/foobadoo',
-     'status': 'Active Development',
-     'uri': '/babadoo/foobadoo',
-     'web_link': 'http://launchpad.../babadoo/foobadoo'}
+    >>> pprint_entry(timeline)
+    is_development_focus: False
+    landmarks: []
+    name: 'foobadoo'
+    project_link: 'http://.../babadoo'
+    resource_type_link: 'http://.../#timeline_project_series'
+    self_link: 'http://.../babadoo/foobadoo'
+    status: 'Active Development'
+    uri: '/babadoo/foobadoo'
+    web_link: 'http://launchpad.../babadoo/foobadoo'
 
 
 Creating a milestone on the product series
diff --git a/requirements/launchpad.txt b/requirements/launchpad.txt
index 43df834..23efe17 100644
--- a/requirements/launchpad.txt
+++ b/requirements/launchpad.txt
@@ -72,7 +72,7 @@ lazr.delegates==2.0.4
 lazr.enum==1.2
 lazr.jobrunner==0.17
 lazr.lifecycle==1.2
-lazr.restful==1.0.2
+lazr.restful==1.0.3
 lazr.restfulclient==0.14.3
 lazr.sshserver==0.1.11
 lazr.uri==1.0.5