diff --git a/gcloud/storage/test_api.py b/gcloud/storage/test_api.py index b20143ac53e4..19e803fcdcfc 100644 --- a/gcloud/storage/test_api.py +++ b/gcloud/storage/test_api.py @@ -119,7 +119,8 @@ def _get_all_buckets_non_empty_helper(self, use_default=False): ]) http = conn._http = Http( {'status': '200', 'content-type': 'application/json'}, - '{{"items": [{{"name": "{0}"}}]}}'.format(BUCKET_NAME).encode('utf-8'), + '{{"items": [{{"name": "{0}"}}]}}'.format(BUCKET_NAME) + .encode('utf-8'), ) if use_default: @@ -161,7 +162,7 @@ def test_miss(self): ]) http = conn._http = Http( {'status': '404', 'content-type': 'application/json'}, - '{}', + b'{}', ) self.assertRaises(NotFound, self._callFUT, NONESUCH, connection=conn) self.assertEqual(http._called_with['method'], 'GET') @@ -183,7 +184,7 @@ def _get_bucket_hit_helper(self, use_default=False): ]) http = conn._http = Http( {'status': '200', 'content-type': 'application/json'}, - '{"name": "%s"}' % BLOB_NAME, + '{{"name": "{0}"}}'.format(BLOB_NAME).encode('utf-8'), ) if use_default: @@ -226,7 +227,7 @@ def _create_bucket_success_helper(self, use_default=False): ]) http = conn._http = Http( {'status': '200', 'content-type': 'application/json'}, - '{"name": "%s"}' % BLOB_NAME, + '{{"name": "{0}"}}'.format(BLOB_NAME).encode('utf-8'), ) if use_default: