Skip to content

Commit

Permalink
Fix on-the-wire repr for 'blob_name_prefix'.
Browse files Browse the repository at this point in the history
The back-end uses 'object_name_prefix'.
  • Loading branch information
tseaver committed Sep 22, 2017
1 parent 374b89c commit 61c5d0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions storage/google/cloud/storage/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, bucket, topic_name,
self._properties['event_types'] = event_types

if blob_name_prefix is not None:
self._properties['blob_name_prefix'] = blob_name_prefix
self._properties['object_name_prefix'] = blob_name_prefix

self._properties['payload_format'] = payload_format

Expand Down Expand Up @@ -161,7 +161,7 @@ def event_types(self):
def blob_name_prefix(self):
"""Prefix of blob names for which notification events are published.
"""
return self._properties.get('blob_name_prefix')
return self._properties.get('object_name_prefix')

@property
def payload_format(self):
Expand Down
6 changes: 3 additions & 3 deletions storage/tests/unit/test_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_from_api_repr_explicit(self):
'topic': self.TOPIC_ALT_REF,
'custom_attributes': self.CUSTOM_ATTRIBUTES,
'event_types': self.event_types(),
'blob_name_prefix': self.BLOB_NAME_PREFIX,
'object_name_prefix': self.BLOB_NAME_PREFIX,
'payload_format': self.payload_format(),
'id': self.NOTIFICATION_ID,
'etag': self.ETAG,
Expand Down Expand Up @@ -288,7 +288,7 @@ def test_create_w_explicit_client(self):
'topic': self.TOPIC_ALT_REF,
'custom_attributes': self.CUSTOM_ATTRIBUTES,
'event_types': self.event_types(),
'blob_name_prefix': self.BLOB_NAME_PREFIX,
'object_name_prefix': self.BLOB_NAME_PREFIX,
'payload_format': self.payload_format(),
'id': self.NOTIFICATION_ID,
'etag': self.ETAG,
Expand All @@ -311,7 +311,7 @@ def test_create_w_explicit_client(self):
'topic': self.TOPIC_ALT_REF,
'custom_attributes': self.CUSTOM_ATTRIBUTES,
'event_types': self.event_types(),
'blob_name_prefix': self.BLOB_NAME_PREFIX,
'object_name_prefix': self.BLOB_NAME_PREFIX,
'payload_format': self.payload_format(),
}
api_request.assert_called_once_with(
Expand Down

0 comments on commit 61c5d0f

Please sign in to comment.