-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add 'Bucket.labels' property. #3478
Conversation
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 pending nits
:setter: Set labels for this bucket. | ||
:getter: Gets the labels for this bucket. | ||
|
||
:rtype: :class:`dict` |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -55,7 +55,8 @@ def test_ctor_with_encoded_unicode(self): | |||
blob_name = b'wet \xe2\x9b\xb5' | |||
blob = self._make_one(blob_name, bucket=None) | |||
unicode_name = u'wet \N{sailboat}' | |||
self.assertNotEqual(blob.name, blob_name) | |||
self.assertNotIsInstance(blob.name, bytes) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
storage/tests/unit/test_blob.py
Outdated
@@ -55,7 +55,8 @@ def test_ctor_with_encoded_unicode(self): | |||
blob_name = b'wet \xe2\x9b\xb5' | |||
blob = self._make_one(blob_name, bucket=None) | |||
unicode_name = u'wet \N{sailboat}' | |||
self.assertNotEqual(blob.name, blob_name) | |||
self.assertNotIsInstance(blob.name, bytes) | |||
self.assertIsInstance(blob.name, type(unicode_name)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
storage/tests/unit/test_bucket.py
Outdated
self.assertEqual(bucket.labels, {}) | ||
bucket.labels = LABELS | ||
self.assertEqual(bucket.labels, LABELS) | ||
self.assertTrue('labels' in bucket._changes) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I will merge when CI is green. |
storage/tests/unit/test_bucket.py
Outdated
self.assertEqual(bucket.labels, {}) | ||
bucket.labels = LABELS | ||
self.assertEqual(bucket.labels, LABELS) | ||
self.assertIsNot(bucket.labels, LABELS) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Avoid UnicodeWarning reported by new py.test * Add 'Bucket.labels' property. See: https://cloud.google.com/storage/docs/json_api/v1/buckets#labels Closes googleapis#3473.
* Avoid UnicodeWarning reported by new py.test * Add 'Bucket.labels' property. See: https://cloud.google.com/storage/docs/json_api/v1/buckets#labels Closes googleapis#3473.
* Avoid UnicodeWarning reported by new py.test * Add 'Bucket.labels' property. See: https://cloud.google.com/storage/docs/json_api/v1/buckets#labels Closes googleapis#3473.
…/python-docs-samples#3478) Use new effective_severity field fixes b/142836422
See: https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
Closes #3473.