@@ -33,7 +33,7 @@ def _make_one(self, *args, **kw):
3333 def test_publisher_api_wo_gax (self ):
3434 from google .cloud .pubsub ._http import _PublisherAPI
3535
36- creds = _Credentials ()
36+ creds = object ()
3737
3838 client = self ._make_one (
3939 project = self .PROJECT , credentials = creds ,
@@ -52,7 +52,7 @@ def test_no_gax_ctor(self):
5252 import mock
5353 from google .cloud .pubsub ._http import _PublisherAPI
5454
55- creds = _Credentials ()
55+ creds = object ()
5656 with mock .patch ('google.cloud.pubsub.client._USE_GAX' ,
5757 new = True ):
5858 client = self ._make_one (project = self .PROJECT , credentials = creds ,
@@ -78,7 +78,7 @@ def __init__(self, _wrapped, client):
7878 self ._wrapped = _wrapped
7979 self ._client = client
8080
81- creds = _Credentials ()
81+ creds = object ()
8282 client = self ._make_one (
8383 project = self .PROJECT , credentials = creds ,
8484 use_gax = True )
@@ -102,7 +102,7 @@ def __init__(self, _wrapped, client):
102102 def test_subscriber_api_wo_gax (self ):
103103 from google .cloud .pubsub ._http import _SubscriberAPI
104104
105- creds = _Credentials ()
105+ creds = object ()
106106 client = self ._make_one (
107107 project = self .PROJECT , credentials = creds ,
108108 use_gax = False )
@@ -132,7 +132,7 @@ def __init__(self, _wrapped, client):
132132 self ._wrapped = _wrapped
133133 self ._client = client
134134
135- creds = _Credentials ()
135+ creds = object ()
136136 client = self ._make_one (
137137 project = self .PROJECT , credentials = creds ,
138138 use_gax = True )
@@ -155,7 +155,7 @@ def __init__(self, _wrapped, client):
155155
156156 def test_iam_policy_api (self ):
157157 from google .cloud .pubsub ._http import _IAMPolicyAPI
158- creds = _Credentials ()
158+ creds = object ()
159159 client = self ._make_one (project = self .PROJECT , credentials = creds )
160160 conn = client ._connection = object ()
161161 api = client .iam_policy_api
@@ -168,7 +168,7 @@ def test_iam_policy_api(self):
168168 def test_list_topics_no_paging (self ):
169169 from google .cloud .pubsub .topic import Topic
170170
171- creds = _Credentials ()
171+ creds = object ()
172172 client = self ._make_one (project = self .PROJECT , credentials = creds )
173173 client ._connection = object ()
174174 api = _FauxPublisherAPI (items = [Topic (self .TOPIC_NAME , client )])
@@ -191,7 +191,7 @@ def test_list_topics_with_paging(self):
191191 TOKEN1 = 'TOKEN1'
192192 TOKEN2 = 'TOKEN2'
193193 SIZE = 1
194- creds = _Credentials ()
194+ creds = object ()
195195 client = self ._make_one (project = self .PROJECT , credentials = creds )
196196 client ._connection = object ()
197197 api = _FauxPublisherAPI ([Topic (self .TOPIC_NAME , client )], TOKEN2 )
@@ -209,7 +209,7 @@ def test_list_topics_with_paging(self):
209209 self .assertEqual (api ._listed_topics , (self .PROJECT , 1 , TOKEN1 ))
210210
211211 def test_list_topics_missing_key (self ):
212- creds = _Credentials ()
212+ creds = object ()
213213 client = self ._make_one (project = self .PROJECT , credentials = creds )
214214 client ._connection = object ()
215215 api = _FauxPublisherAPI ()
@@ -229,7 +229,7 @@ def test_list_subscriptions_no_paging(self):
229229 from google .cloud .pubsub .topic import Topic
230230
231231 SUB_INFO = {'name' : self .SUB_PATH , 'topic' : self .TOPIC_PATH }
232- creds = _Credentials ()
232+ creds = object ()
233233 client = self ._make_one (project = self .PROJECT , credentials = creds ,
234234 use_gax = False )
235235 returned = {'subscriptions' : [SUB_INFO ]}
@@ -267,7 +267,7 @@ def test_list_subscriptions_with_paging(self):
267267 from google .cloud .pubsub .topic import Topic
268268
269269 SUB_INFO = {'name' : self .SUB_PATH , 'topic' : self .TOPIC_PATH }
270- creds = _Credentials ()
270+ creds = object ()
271271 client = self ._make_one (project = self .PROJECT , credentials = creds ,
272272 use_gax = False )
273273
@@ -320,7 +320,7 @@ def test_list_subscriptions_with_paging(self):
320320
321321 def test_list_subscriptions_w_missing_key (self ):
322322 PROJECT = 'PROJECT'
323- creds = _Credentials ()
323+ creds = object ()
324324
325325 client = self ._make_one (project = PROJECT , credentials = creds )
326326 client ._connection = object ()
@@ -338,7 +338,7 @@ def test_list_subscriptions_w_missing_key(self):
338338 def test_topic (self ):
339339 PROJECT = 'PROJECT'
340340 TOPIC_NAME = 'TOPIC_NAME'
341- creds = _Credentials ()
341+ creds = object ()
342342
343343 client_obj = self ._make_one (project = PROJECT , credentials = creds )
344344 new_topic = client_obj .topic (TOPIC_NAME )
@@ -350,19 +350,6 @@ def test_topic(self):
350350 self .assertFalse (new_topic .timestamp_messages )
351351
352352
353- class _Credentials (object ):
354-
355- _scopes = None
356-
357- @staticmethod
358- def create_scoped_required ():
359- return True
360-
361- def create_scoped (self , scope ):
362- self ._scopes = scope
363- return self
364-
365-
366353class _Iterator (object ):
367354
368355 def __init__ (self , items , token ):
0 commit comments