Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
tests: avoid requiring real credentials in unit tests - #459
Merged
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.
tseaverforce-pushed
the
416-avoid_real_client_in_bucket_blob_unit_tests
branch
from
June 8, 2021 21:11
cc643b2 to
a694cabCompare
This was referenced Jun 9, 2021
| client.list_blobs.assert_called_once() | ||
| def test_page_empty_response(self): |
ContributorAuthor
There was a problem hiding this comment.
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).
| response.request = requests.Request("POST", "http://example.com").prepare() | ||
| return response | ||
| def test__extract_headers_from_download_gzipped(self): |
ContributorAuthor
There was a problem hiding this comment.
The tests were misnamed, and out of place: I just fixed that, and split a couple of over-large ones.
cojenco pushed a commit
to cojenco/python-storage
that referenced
this pull request
Oct 13, 2021
Adjust 'Bucket.get_upload_policy' to use credentials from the client, rather than its connection. Closesgoogleapis#416.
cojenco pushed a commit
to cojenco/python-storage
that referenced
this pull request
Oct 13, 2021
Adjust 'Bucket.get_upload_policy' to use credentials from the client, rather than its connection. Closesgoogleapis#416.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#416