diff options
| author | Barry Warsaw | 2017-02-06 09:54:05 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2017-02-06 09:55:00 -0500 |
| commit | 26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc (patch) | |
| tree | db590d461c1e9c956c1f562f826d8ba0ddf405b3 /src/mailman/testing/documentation.py | |
| parent | a75a718fa9073a51df8ce4deafe8a4851818b0a7 (diff) | |
| download | mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.tar.gz mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.tar.zst mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.zip | |
Diffstat (limited to 'src/mailman/testing/documentation.py')
| -rw-r--r-- | src/mailman/testing/documentation.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mailman/testing/documentation.py b/src/mailman/testing/documentation.py index 33678a7d0..fc75e7a93 100644 --- a/src/mailman/testing/documentation.py +++ b/src/mailman/testing/documentation.py @@ -92,8 +92,17 @@ def call_http(url, data=None, method=None, username=None, password=None): """ content, response = call_api(url, data, method, username, password) if content is None: - for header in sorted(response): - print('{}: {}'.format(header, response[header])) + # We used to use httplib2 here, which included the status code in the + # response headers in the `status` key. requests doesn't do this, but + # the doctests expect it so for backward compatibility, include the + # status code in the printed response. + headers = dict(status=response.status_code) + headers.update({ + field.lower(): response.headers[field] + for field in response.headers + }) + for field in sorted(headers): + print('{}: {}'.format(field, headers[field])) return None return content |
