@@ -106,59 +106,6 @@ def test_ctor_explicit(self):
106106 self .assertFalse (bucket ._default_object_acl .loaded )
107107 self .assertTrue (bucket ._default_object_acl .bucket is bucket )
108108
109- def test___iter___empty (self ):
110- from gcloud .storage ._testing import _monkey_defaults
111- NAME = 'name'
112- connection = _Connection ({'items' : []})
113- bucket = self ._makeOne (NAME )
114- with _monkey_defaults (connection = connection ):
115- blobs = list (bucket )
116- self .assertEqual (blobs , [])
117- kw , = connection ._requested
118- self .assertEqual (kw ['method' ], 'GET' )
119- self .assertEqual (kw ['path' ], '/b/%s/o' % NAME )
120- self .assertEqual (kw ['query_params' ], {'projection' : 'noAcl' })
121-
122- def test___iter___non_empty (self ):
123- from gcloud .storage ._testing import _monkey_defaults
124- NAME = 'name'
125- BLOB_NAME = 'blob-name'
126- connection = _Connection ({'items' : [{'name' : BLOB_NAME }]})
127- bucket = self ._makeOne (NAME )
128- with _monkey_defaults (connection = connection ):
129- blobs = list (bucket )
130- blob , = blobs
131- self .assertTrue (blob .bucket is bucket )
132- self .assertEqual (blob .name , BLOB_NAME )
133- kw , = connection ._requested
134- self .assertEqual (kw ['method' ], 'GET' )
135- self .assertEqual (kw ['path' ], '/b/%s/o' % NAME )
136- self .assertEqual (kw ['query_params' ], {'projection' : 'noAcl' })
137-
138- def test___contains___miss (self ):
139- from gcloud .storage ._testing import _monkey_defaults
140- NAME = 'name'
141- NONESUCH = 'nonesuch'
142- connection = _Connection ()
143- bucket = self ._makeOne (NAME )
144- with _monkey_defaults (connection = connection ):
145- self .assertFalse (NONESUCH in bucket )
146- kw , = connection ._requested
147- self .assertEqual (kw ['method' ], 'GET' )
148- self .assertEqual (kw ['path' ], '/b/%s/o/%s' % (NAME , NONESUCH ))
149-
150- def test___contains___hit (self ):
151- from gcloud .storage ._testing import _monkey_defaults
152- NAME = 'name'
153- BLOB_NAME = 'blob-name'
154- connection = _Connection ({'name' : BLOB_NAME })
155- bucket = self ._makeOne (NAME )
156- with _monkey_defaults (connection = connection ):
157- self .assertTrue (BLOB_NAME in bucket )
158- kw , = connection ._requested
159- self .assertEqual (kw ['method' ], 'GET' )
160- self .assertEqual (kw ['path' ], '/b/%s/o/%s' % (NAME , BLOB_NAME ))
161-
162109 def test_exists_miss (self ):
163110 from gcloud .exceptions import NotFound
164111
0 commit comments