← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-FakeResponse-getOutput into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-FakeResponse-getOutput into launchpad:master.

Commit message:
Fix uses of FakeResponse.getOutput() in doctests

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

six.text_type(response) decodes the response, which works better for us.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-FakeResponse-getOutput into launchpad:master.
diff --git a/lib/lp/registry/stories/product/xx-product-files.txt b/lib/lp/registry/stories/product/xx-product-files.txt
index a3238f3..c288ace 100644
--- a/lib/lp/registry/stories/product/xx-product-files.txt
+++ b/lib/lp/registry/stories/product/xx-product-files.txt
@@ -420,7 +420,7 @@ XXX Mon May  7 10:02:49 2007 -- bac
     >>> redirect_resp = http("""
     ...     GET %s HTTP/1.1""" % url_path)
     >>> redirect_url = None
-    >>> for line in redirect_resp.getOutput().splitlines()[1:]:
+    >>> for line in six.text_type(redirect_resp).splitlines()[1:]:
     ...     key, value = line.split(": ", 1)
     ...     if key.lower() == "location":
     ...         redirect_url = value
diff --git a/lib/lp/services/feeds/stories/xx-navigation.txt b/lib/lp/services/feeds/stories/xx-navigation.txt
index 719e10a..5ca7799 100644
--- a/lib/lp/services/feeds/stories/xx-navigation.txt
+++ b/lib/lp/services/feeds/stories/xx-navigation.txt
@@ -52,7 +52,7 @@ redirects to remote sites, but http() can be used instead.
    ... GET / HTTP/1.0
    ... Host: feeds.launchpad.test
    ... """)
-   >>> print(response.getOutput())
+   >>> print(six.text_type(response))
    HTTP/1.0 301 Moved Permanently
    ...
    Location: https://help.launchpad.net/Feeds
diff --git a/lib/lp/services/webservice/stories/xx-service.txt b/lib/lp/services/webservice/stories/xx-service.txt
index 63b40a9..f3a5d3f 100644
--- a/lib/lp/services/webservice/stories/xx-service.txt
+++ b/lib/lp/services/webservice/stories/xx-service.txt
@@ -116,7 +116,7 @@ request, with the OAuth consumer name being equal to the User-Agent.
     ...     return http(request)
 
     >>> response = request_with_user_agent(agent)
-    >>> print(response.getOutput())
+    >>> print(six.text_type(response))
     HTTP/1.1 200 Ok
     ...
     {...}
@@ -125,7 +125,7 @@ An unsigned request, like a request signed with the empty string,
 isn't logged in as any particular user:
 
     >>> response = request_with_user_agent(agent, "/devel/people/+me")
-    >>> print(response.getOutput())
+    >>> print(six.text_type(response))
     HTTP/1.1 401 Unauthorized
     ...
     You need to be logged in to view this URL.