Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: tests/s3/mock_storage_service.py

Issue 8669001: Pull in upstream boto from github at bcb719937de9ac2851e632d62b777352029a6d55 (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/utils.py ('k') | tests/s3/test_gsconnection.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/s3/mock_storage_service.py
diff --git a/tests/s3/mock_storage_service.py b/tests/s3/mock_storage_service.py
index 0f3ea7b8482ab85fcc38411e22ba75d95222ef43..aa28b595826cfacf9a0221bc439eab6a846cc02b 100644
--- a/tests/s3/mock_storage_service.py
+++ b/tests/s3/mock_storage_service.py
@@ -125,6 +125,8 @@ class MockBucket(object):
self.name = name
self.keys = {}
self.acls = {name: MockAcl()}
+ # default object ACLs are one per bucket and not supported for keys
+ self.def_acl = MockAcl()
self.subresources = {}
self.connection = connection
self.logging = False
@@ -153,6 +155,11 @@ class MockBucket(object):
# Return ACL for the bucket.
return self.acls[self.name]
+ def get_def_acl(self, key_name=NOT_IMPL, headers=NOT_IMPL,
+ version_id=NOT_IMPL):
+ # Return default ACL for the bucket.
+ return self.def_acl
+
def get_subresource(self, subresource, key_name=NOT_IMPL, headers=NOT_IMPL,
version_id=NOT_IMPL):
if subresource in self.subresources:
@@ -205,6 +212,13 @@ class MockBucket(object):
# Set ACL for the bucket.
self.acls[self.name] = acl_or_str
+ def set_def_acl(self, acl_or_str, key_name=NOT_IMPL, headers=NOT_IMPL,
+ version_id=NOT_IMPL):
+ # We only handle setting ACL XML here; if you pass a canned ACL
+ # the get_acl call will just return that string name.
+ # Set default ACL for the bucket.
+ self.def_acl = acl_or_str
+
def set_subresource(self, subresource, value, key_name=NOT_IMPL,
headers=NOT_IMPL, version_id=NOT_IMPL):
self.subresources[subresource] = value
@@ -311,6 +325,10 @@ class MockBucketStorageUri(object):
def get_acl(self, validate=NOT_IMPL, headers=NOT_IMPL, version_id=NOT_IMPL):
return self.get_bucket().get_acl(self.object_name)
+ def get_def_acl(self, validate=NOT_IMPL, headers=NOT_IMPL,
+ version_id=NOT_IMPL):
+ return self.get_bucket().get_def_acl(self.object_name)
+
def get_subresource(self, subresource, validate=NOT_IMPL, headers=NOT_IMPL,
version_id=NOT_IMPL):
return self.get_bucket().get_subresource(subresource, self.object_name)
@@ -348,6 +366,10 @@ class MockBucketStorageUri(object):
headers=NOT_IMPL, version_id=NOT_IMPL):
self.get_bucket().set_acl(acl_or_str, key_name)
+ def set_def_acl(self, acl_or_str, key_name=NOT_IMPL, validate=NOT_IMPL,
+ headers=NOT_IMPL, version_id=NOT_IMPL):
+ self.get_bucket().set_def_acl(acl_or_str)
+
def set_subresource(self, subresource, value, validate=NOT_IMPL,
headers=NOT_IMPL, version_id=NOT_IMPL):
self.get_bucket().set_subresource(subresource, value, self.object_name)
« no previous file with comments | « boto/utils.py ('k') | tests/s3/test_gsconnection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698