@@ -28,7 +28,7 @@ def _make_one(self, *args, **kw):
2828 def test_ctor (self ):
2929 from google .cloud .bigquery ._http import Connection
3030 PROJECT = 'PROJECT'
31- creds = _Credentials ()
31+ creds = object ()
3232 http = object ()
3333 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
3434 self .assertIsInstance (client ._connection , Connection )
@@ -57,7 +57,7 @@ def test_list_projects_defaults(self):
5757 'friendlyName' : 'Two' },
5858 ]
5959 }
60- creds = _Credentials ()
60+ creds = object ()
6161 client = self ._make_one (PROJECT_1 , creds )
6262 conn = client ._connection = _Connection (DATA )
6363
@@ -86,7 +86,7 @@ def test_list_projects_explicit_response_missing_projects_key(self):
8686 PATH = 'projects'
8787 TOKEN = 'TOKEN'
8888 DATA = {}
89- creds = _Credentials ()
89+ creds = object ()
9090 client = self ._make_one (PROJECT , creds )
9191 conn = client ._connection = _Connection (DATA )
9292
@@ -128,7 +128,7 @@ def test_list_datasets_defaults(self):
128128 'friendlyName' : 'Two' },
129129 ]
130130 }
131- creds = _Credentials ()
131+ creds = object ()
132132 client = self ._make_one (PROJECT , creds )
133133 conn = client ._connection = _Connection (DATA )
134134
@@ -156,7 +156,7 @@ def test_list_datasets_explicit_response_missing_datasets_key(self):
156156 PATH = 'projects/%s/datasets' % PROJECT
157157 TOKEN = 'TOKEN'
158158 DATA = {}
159- creds = _Credentials ()
159+ creds = object ()
160160 client = self ._make_one (PROJECT , creds )
161161 conn = client ._connection = _Connection (DATA )
162162
@@ -180,7 +180,7 @@ def test_dataset(self):
180180 from google .cloud .bigquery .dataset import Dataset
181181 PROJECT = 'PROJECT'
182182 DATASET = 'dataset_name'
183- creds = _Credentials ()
183+ creds = object ()
184184 http = object ()
185185 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
186186 dataset = client .dataset (DATASET )
@@ -190,7 +190,7 @@ def test_dataset(self):
190190
191191 def test_job_from_resource_unknown_type (self ):
192192 PROJECT = 'PROJECT'
193- creds = _Credentials ()
193+ creds = object ()
194194 client = self ._make_one (PROJECT , creds )
195195 with self .assertRaises (ValueError ):
196196 client .job_from_resource ({'configuration' : {'nonesuch' : {}}})
@@ -304,7 +304,7 @@ def test_list_jobs_defaults(self):
304304 LOAD_DATA ,
305305 ]
306306 }
307- creds = _Credentials ()
307+ creds = object ()
308308 client = self ._make_one (PROJECT , creds )
309309 conn = client ._connection = _Connection (DATA )
310310
@@ -360,7 +360,7 @@ def test_list_jobs_load_job_wo_sourceUris(self):
360360 LOAD_DATA ,
361361 ]
362362 }
363- creds = _Credentials ()
363+ creds = object ()
364364 client = self ._make_one (PROJECT , creds )
365365 conn = client ._connection = _Connection (DATA )
366366
@@ -388,7 +388,7 @@ def test_list_jobs_explicit_missing(self):
388388 PATH = 'projects/%s/jobs' % PROJECT
389389 DATA = {}
390390 TOKEN = 'TOKEN'
391- creds = _Credentials ()
391+ creds = object ()
392392 client = self ._make_one (PROJECT , creds )
393393 conn = client ._connection = _Connection (DATA )
394394
@@ -419,7 +419,7 @@ def test_load_table_from_storage(self):
419419 DATASET = 'dataset_name'
420420 DESTINATION = 'destination_table'
421421 SOURCE_URI = 'http://example.com/source.csv'
422- creds = _Credentials ()
422+ creds = object ()
423423 http = object ()
424424 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
425425 dataset = client .dataset (DATASET )
@@ -438,7 +438,7 @@ def test_copy_table(self):
438438 DATASET = 'dataset_name'
439439 SOURCE = 'source_table'
440440 DESTINATION = 'destination_table'
441- creds = _Credentials ()
441+ creds = object ()
442442 http = object ()
443443 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
444444 dataset = client .dataset (DATASET )
@@ -458,7 +458,7 @@ def test_extract_table_to_storage(self):
458458 DATASET = 'dataset_name'
459459 SOURCE = 'source_table'
460460 DESTINATION = 'gs://bucket_name/object_name'
461- creds = _Credentials ()
461+ creds = object ()
462462 http = object ()
463463 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
464464 dataset = client .dataset (DATASET )
@@ -475,7 +475,7 @@ def test_run_async_query_defaults(self):
475475 PROJECT = 'PROJECT'
476476 JOB = 'job_name'
477477 QUERY = 'select count(*) from persons'
478- creds = _Credentials ()
478+ creds = object ()
479479 http = object ()
480480 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
481481 job = client .run_async_query (JOB , QUERY )
@@ -511,7 +511,7 @@ def test_run_async_w_query_parameters(self):
511511 PROJECT = 'PROJECT'
512512 JOB = 'job_name'
513513 QUERY = 'select count(*) from persons'
514- creds = _Credentials ()
514+ creds = object ()
515515 http = object ()
516516 client = self ._make_one (project = PROJECT , credentials = creds , http = http )
517517 query_parameters = [ScalarQueryParameter ('foo' , 'INT64' , 123 )]
@@ -575,19 +575,6 @@ def test_run_sync_query_w_query_parameters(self):
575575 self .assertEqual (query .query_parameters , query_parameters )
576576
577577
578- class _Credentials (object ):
579-
580- _scopes = None
581-
582- @staticmethod
583- def create_scoped_required ():
584- return True
585-
586- def create_scoped (self , scope ):
587- self ._scopes = scope
588- return self
589-
590-
591578class _Connection (object ):
592579
593580 def __init__ (self , * responses ):
0 commit comments