@@ -260,7 +260,7 @@ def test_generate_signed_url_w_method_arg(self):
260
260
def test_exists_miss (self ):
261
261
from six .moves .http_client import NOT_FOUND
262
262
NONESUCH = 'nonesuch'
263
- not_found_response = {'status' : NOT_FOUND }
263
+ not_found_response = ( {'status' : NOT_FOUND }, b'' )
264
264
connection = _Connection (not_found_response )
265
265
client = _Client (connection )
266
266
bucket = _Bucket (client )
@@ -270,7 +270,7 @@ def test_exists_miss(self):
270
270
def test_exists_hit (self ):
271
271
from six .moves .http_client import OK
272
272
BLOB_NAME = 'blob-name'
273
- found_response = {'status' : OK }
273
+ found_response = ( {'status' : OK }, b'' )
274
274
connection = _Connection (found_response )
275
275
client = _Client (connection )
276
276
bucket = _Bucket (client )
@@ -281,7 +281,7 @@ def test_exists_hit(self):
281
281
def test_delete (self ):
282
282
from six .moves .http_client import NOT_FOUND
283
283
BLOB_NAME = 'blob-name'
284
- not_found_response = {'status' : NOT_FOUND }
284
+ not_found_response = ( {'status' : NOT_FOUND }, b'' )
285
285
connection = _Connection (not_found_response )
286
286
client = _Client (connection )
287
287
bucket = _Bucket (client )
@@ -749,10 +749,11 @@ def test_upload_from_string_w_text(self):
749
749
self .assertEqual (rq [0 ]['body' ], ENCODED )
750
750
751
751
def test_make_public (self ):
752
+ from six .moves .http_client import OK
752
753
from gcloud .storage .acl import _ACLEntity
753
754
BLOB_NAME = 'blob-name'
754
755
permissive = [{'entity' : 'allUsers' , 'role' : _ACLEntity .READER_ROLE }]
755
- after = { ' acl' : permissive }
756
+ after = ({ 'status' : OK }, { ' acl' : permissive })
756
757
connection = _Connection (after )
757
758
client = _Client (connection )
758
759
bucket = _Bucket (client = client )
@@ -1092,10 +1093,10 @@ def __init__(self, *responses):
1092
1093
def api_request (self , ** kw ):
1093
1094
from six .moves .http_client import NOT_FOUND
1094
1095
from gcloud .exceptions import NotFound
1095
- result = self ._respond (** kw )
1096
- if result .get ('status' ) == NOT_FOUND :
1097
- raise NotFound (result )
1098
- return result
1096
+ info , content = self ._respond (** kw )
1097
+ if info .get ('status' ) == NOT_FOUND :
1098
+ raise NotFound (info )
1099
+ return content
1099
1100
1100
1101
def build_api_url (self , path , query_params = None ,
1101
1102
api_base_url = API_BASE_URL ):
0 commit comments