-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: avoid requiring real credentials in unit tests #459
tests: avoid requiring real credentials in unit tests #459
Conversation
Also, adjust 'Bucket.get_upload_policy' to use credentials from the client, rather than its connection. Remove last uses of '_Client' and '_Connection' shims: use a mocked client instead. Toward #416.
cc643b2
to
a694cab
Compare
@@ -3351,96 +3348,14 @@ def test_make_private_recursive_too_many(self): | |||
|
|||
client.list_blobs.assert_called_once() | |||
|
|||
def test_page_empty_response(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these tests being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are non-unit tests (they really only test the already-well-tested api_core.page_iterator.Iterator
). The local bits are replaced by the (new) explicit tests of _item_to_blob
and _blobs_page_start
(at the top of the file).
@@ -1024,6 +1021,99 @@ def _mock_requests_response(status_code, headers, content=b""): | |||
response.request = requests.Request("POST", "http://example.com").prepare() | |||
return response | |||
|
|||
def test__extract_headers_from_download_gzipped(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding coverage, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests were misnamed, and out of place: I just fixed that, and split a couple of over-large ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adjust 'Bucket.get_upload_policy' to use credentials from the client, rather than its connection. Closes googleapis#416.
Adjust 'Bucket.get_upload_policy' to use credentials from the client, rather than its connection. Closes googleapis#416.
Fixes #416