Ensure uri module always returns status even on failure (#56240)

- Also return url and update docs for other values to indicate they are only returned on success.
- Add integration tests
- Use info variable for common return values
- Use -1 as default status rather than None. This is lines up with with existing code in urls.py
- Add unit tests to ensure status and url are returned on failure
This commit is contained in:
Sam Doran 2019-05-23 10:17:17 -04:00 committed by GitHub
parent 22b9525aa9
commit 8f4f3750fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 8 deletions

View file

@ -314,7 +314,7 @@ RETURN = r'''
# The return information includes all the HTTP headers in lower-case.
elapsed:
description: The number of seconds that elapsed while performing the download
returned: always
returned: on success
type: int
sample: 23
msg:
@ -324,7 +324,7 @@ msg:
sample: OK (unknown bytes)
redirected:
description: Whether the request was redirected
returned: always
returned: on success
type: bool
sample: false
status: