Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gcloud/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

from gcloud import credentials
from gcloud.storage import _implicit_environ
from gcloud.storage.blob import Blob
from gcloud.storage.bucket import Bucket
from gcloud.storage.connection import Connection

Expand Down
14 changes: 7 additions & 7 deletions regression/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def tearDown(self):
class TestStorageWriteFiles(TestStorageFiles):

def test_large_file_write_from_stream(self):
blob = self.bucket.new_blob('LargeFile')
blob = storage.Blob(bucket=self.bucket, name='LargeFile')
self.assertEqual(blob._properties, {})

file_data = self.FILES['big']
Expand All @@ -128,7 +128,7 @@ def test_large_file_write_from_stream(self):
self.assertEqual(blob.md5_hash, file_data['hash'])

def test_small_file_write_from_filename(self):
blob = self.bucket.new_blob('LargeFile')
blob = storage.Blob(bucket=self.bucket, name='LargeFile')
self.assertEqual(blob._properties, {})

file_data = self.FILES['simple']
Expand All @@ -149,12 +149,12 @@ def test_write_metadata(self):
self.assertEqual(blob.content_type, 'image/png')

def test_direct_write_and_read_into_file(self):
blob = self.bucket.new_blob('MyBuffer')
blob = storage.Blob(bucket=self.bucket, name='MyBuffer')
file_contents = 'Hello World'
blob.upload_from_string(file_contents)
self.case_blobs_to_delete.append(blob)

same_blob = self.bucket.new_blob('MyBuffer')
same_blob = storage.Blob(bucket=self.bucket, name='MyBuffer')
temp_filename = tempfile.mktemp()
with open(temp_filename, 'w') as file_obj:
same_blob.download_to_file(file_obj)
Expand Down Expand Up @@ -306,7 +306,7 @@ def setUp(self):
with open(logo_path, 'r') as file_obj:
self.LOCAL_FILE = file_obj.read()

blob = self.bucket.new_blob('LogoToSign.jpg')
blob = storage.Blob(bucket=self.bucket, name='LogoToSign.jpg')
blob.upload_from_string(self.LOCAL_FILE)
self.case_blobs_to_delete.append(blob)

Expand All @@ -316,7 +316,7 @@ def tearDown(self):
blob.delete()

def test_create_signed_read_url(self):
blob = self.bucket.new_blob('LogoToSign.jpg')
blob = storage.Blob(bucket=self.bucket, name='LogoToSign.jpg')
expiration = int(time.time() + 5)
signed_url = blob.generate_signed_url(expiration, method='GET')

Expand All @@ -325,7 +325,7 @@ def test_create_signed_read_url(self):
self.assertEqual(content, self.LOCAL_FILE)

def test_create_signed_delete_url(self):
blob = self.bucket.new_blob('LogoToSign.jpg')
blob = storage.Blob(bucket=self.bucket, name='LogoToSign.jpg')
expiration = int(time.time() + 283473274)
signed_delete_url = blob.generate_signed_url(expiration,
method='DELETE')
Expand Down