Skip to content
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

Merged
merged 2 commits into from
Jun 6, 2017
Merged

Add 'Bucket.labels' property. #3478

merged 2 commits into from
Jun 6, 2017

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Jun 6, 2017

@tseaver tseaver added api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 6, 2017
@tseaver tseaver requested review from lukesneeringer and dhermes June 6, 2017 21:19
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 6, 2017
Copy link
Contributor

@dhermes dhermes left a 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.

@@ -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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -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.

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.

@tseaver
Copy link
Contributor Author

tseaver commented Jun 6, 2017

I will merge when CI is green.

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.

@tseaver tseaver merged commit 179997e into googleapis:master Jun 6, 2017
@tseaver tseaver deleted the 3473-storage-bucket_labels branch June 6, 2017 23:01
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 21, 2017
* 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.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
* 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.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
* 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.
parthea pushed a commit that referenced this pull request Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants