Skip to content

Commit 61c5d0f

Browse files
committed
Fix on-the-wire repr for 'blob_name_prefix'.
The back-end uses 'object_name_prefix'.
1 parent 374b89c commit 61c5d0f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

storage/google/cloud/storage/notification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(self, bucket, topic_name,
8787
self._properties['event_types'] = event_types
8888

8989
if blob_name_prefix is not None:
90-
self._properties['blob_name_prefix'] = blob_name_prefix
90+
self._properties['object_name_prefix'] = blob_name_prefix
9191

9292
self._properties['payload_format'] = payload_format
9393

@@ -161,7 +161,7 @@ def event_types(self):
161161
def blob_name_prefix(self):
162162
"""Prefix of blob names for which notification events are published.
163163
"""
164-
return self._properties.get('blob_name_prefix')
164+
return self._properties.get('object_name_prefix')
165165

166166
@property
167167
def payload_format(self):

storage/tests/unit/test_notification.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def test_from_api_repr_explicit(self):
167167
'topic': self.TOPIC_ALT_REF,
168168
'custom_attributes': self.CUSTOM_ATTRIBUTES,
169169
'event_types': self.event_types(),
170-
'blob_name_prefix': self.BLOB_NAME_PREFIX,
170+
'object_name_prefix': self.BLOB_NAME_PREFIX,
171171
'payload_format': self.payload_format(),
172172
'id': self.NOTIFICATION_ID,
173173
'etag': self.ETAG,
@@ -288,7 +288,7 @@ def test_create_w_explicit_client(self):
288288
'topic': self.TOPIC_ALT_REF,
289289
'custom_attributes': self.CUSTOM_ATTRIBUTES,
290290
'event_types': self.event_types(),
291-
'blob_name_prefix': self.BLOB_NAME_PREFIX,
291+
'object_name_prefix': self.BLOB_NAME_PREFIX,
292292
'payload_format': self.payload_format(),
293293
'id': self.NOTIFICATION_ID,
294294
'etag': self.ETAG,
@@ -311,7 +311,7 @@ def test_create_w_explicit_client(self):
311311
'topic': self.TOPIC_ALT_REF,
312312
'custom_attributes': self.CUSTOM_ATTRIBUTES,
313313
'event_types': self.event_types(),
314-
'blob_name_prefix': self.BLOB_NAME_PREFIX,
314+
'object_name_prefix': self.BLOB_NAME_PREFIX,
315315
'payload_format': self.payload_format(),
316316
}
317317
api_request.assert_called_once_with(

0 commit comments

Comments
 (0)