@@ -142,7 +142,7 @@ def test_delete(self):
142142 key .delete ()
143143 self .assertFalse (key .exists ())
144144
145- def test_get_contents_to_file (self ):
145+ def test_download_to_file (self ):
146146 from StringIO import StringIO
147147 from gcloud ._testing import _Monkey
148148 from gcloud .storage import key as MUT
@@ -153,10 +153,10 @@ def test_get_contents_to_file(self):
153153 key = self ._makeOne (bucket , KEY )
154154 fh = StringIO ()
155155 with _Monkey (MUT , KeyDataIterator = lambda self : iter (_CHUNKS )):
156- key .get_contents_to_file (fh )
156+ key .download_to_file (fh )
157157 self .assertEqual (fh .getvalue (), '' .join (_CHUNKS ))
158158
159- def test_get_contents_to_filename (self ):
159+ def test_download_to_filename (self ):
160160 from tempfile import NamedTemporaryFile
161161 from gcloud ._testing import _Monkey
162162 from gcloud .storage import key as MUT
@@ -167,13 +167,13 @@ def test_get_contents_to_filename(self):
167167 key = self ._makeOne (bucket , KEY )
168168 with _Monkey (MUT , KeyDataIterator = lambda self : iter (_CHUNKS )):
169169 with NamedTemporaryFile () as f :
170- key .get_contents_to_filename (f .name )
170+ key .download_to_filename (f .name )
171171 f .flush ()
172172 with open (f .name ) as g :
173173 wrote = g .read ()
174174 self .assertEqual (wrote , '' .join (_CHUNKS ))
175175
176- def test_get_contents_as_string (self ):
176+ def test_download_as_string (self ):
177177 from gcloud ._testing import _Monkey
178178 from gcloud .storage import key as MUT
179179 _CHUNKS = ['abc' , 'def' ]
@@ -182,10 +182,10 @@ def test_get_contents_as_string(self):
182182 bucket = _Bucket (connection )
183183 key = self ._makeOne (bucket , KEY )
184184 with _Monkey (MUT , KeyDataIterator = lambda self : iter (_CHUNKS )):
185- fetched = key .get_contents_as_string ()
185+ fetched = key .download_as_string ()
186186 self .assertEqual (fetched , '' .join (_CHUNKS ))
187187
188- def test_set_contents_from_file (self ):
188+ def test_upload_from_file (self ):
189189 from tempfile import NamedTemporaryFile
190190 from urlparse import parse_qsl
191191 from urlparse import urlsplit
@@ -206,7 +206,7 @@ def test_set_contents_from_file(self):
206206 with NamedTemporaryFile () as fh :
207207 fh .write (DATA )
208208 fh .flush ()
209- key .set_contents_from_file (fh , rewind = True )
209+ key .upload_from_file (fh , rewind = True )
210210 rq = connection ._requested
211211 self .assertEqual (len (rq ), 3 )
212212 self .assertEqual (rq [0 ]['method' ], 'POST' )
@@ -231,7 +231,7 @@ def test_set_contents_from_file(self):
231231 self .assertEqual (rq [2 ]['data' ], DATA [5 :])
232232 self .assertEqual (rq [2 ]['headers' ], {'Content-Range' : 'bytes 5-5/6' })
233233
234- def test_set_contents_from_filename (self ):
234+ def test_upload_from_filename (self ):
235235 from tempfile import NamedTemporaryFile
236236 from urlparse import parse_qsl
237237 from urlparse import urlsplit
@@ -252,7 +252,7 @@ def test_set_contents_from_filename(self):
252252 with NamedTemporaryFile (suffix = '.jpeg' ) as fh :
253253 fh .write (DATA )
254254 fh .flush ()
255- key .set_contents_from_filename (fh .name )
255+ key .upload_from_filename (fh .name )
256256 rq = connection ._requested
257257 self .assertEqual (len (rq ), 3 )
258258 self .assertEqual (rq [0 ]['method' ], 'POST' )
@@ -277,7 +277,7 @@ def test_set_contents_from_filename(self):
277277 self .assertEqual (rq [2 ]['data' ], DATA [5 :])
278278 self .assertEqual (rq [2 ]['headers' ], {'Content-Range' : 'bytes 5-5/6' })
279279
280- def test_set_contents_from_string (self ):
280+ def test_upload_from_string (self ):
281281 from urlparse import parse_qsl
282282 from urlparse import urlsplit
283283 KEY = 'key'
@@ -294,7 +294,7 @@ def test_set_contents_from_string(self):
294294 bucket = _Bucket (connection )
295295 key = self ._makeOne (bucket , KEY )
296296 key .CHUNK_SIZE = 5
297- key .set_contents_from_string (DATA )
297+ key .upload_from_string (DATA )
298298 rq = connection ._requested
299299 self .assertEqual (len (rq ), 3 )
300300 self .assertEqual (rq [0 ]['method' ], 'POST' )
0 commit comments