Skip to content

Commit 908fd1d

Browse files
committed
Changing all instances of _makeOne to _make_one.
Done via: $ git grep -l _makeOne | \ > xargs sed -i s/_makeOne/_make_one/g
1 parent 3a81c25 commit 908fd1d

99 files changed

Lines changed: 2059 additions & 2059 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bigquery/unit_tests/test__helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def _get_target_class():
323323
from google.cloud.bigquery._helpers import _ConfigurationProperty
324324
return _ConfigurationProperty
325325

326-
def _makeOne(self, *args, **kw):
326+
def _make_one(self, *args, **kw):
327327
return self._get_target_class()(*args, **kw)
328328

329329
def test_it(self):
@@ -332,7 +332,7 @@ class Configuration(object):
332332
_attr = None
333333

334334
class Wrapper(object):
335-
attr = self._makeOne('attr')
335+
attr = self._make_one('attr')
336336

337337
def __init__(self):
338338
self._configuration = Configuration()
@@ -359,7 +359,7 @@ def _get_target_class():
359359
from google.cloud.bigquery._helpers import _TypedProperty
360360
return _TypedProperty
361361

362-
def _makeOne(self, *args, **kw):
362+
def _make_one(self, *args, **kw):
363363
return self._get_target_class()(*args, **kw)
364364

365365
def test_it(self):
@@ -368,7 +368,7 @@ class Configuration(object):
368368
_attr = None
369369

370370
class Wrapper(object):
371-
attr = self._makeOne('attr', int)
371+
attr = self._make_one('attr', int)
372372

373373
def __init__(self):
374374
self._configuration = Configuration()
@@ -427,11 +427,11 @@ def _get_target_class():
427427
from google.cloud.bigquery._helpers import UDFResourcesProperty
428428
return UDFResourcesProperty
429429

430-
def _makeOne(self, *args, **kw):
430+
def _make_one(self, *args, **kw):
431431
return self._get_target_class()(*args, **kw)
432432

433433
def _descriptor_and_klass(self):
434-
descriptor = self._makeOne()
434+
descriptor = self._make_one()
435435

436436
class _Test(object):
437437
_udf_resources = ()

bigquery/unit_tests/test__http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def _get_target_class():
2222
from google.cloud.bigquery._http import Connection
2323
return Connection
2424

25-
def _makeOne(self, *args, **kw):
25+
def _make_one(self, *args, **kw):
2626
return self._get_target_class()(*args, **kw)
2727

2828
def test_build_api_url_no_extra_query_params(self):
29-
conn = self._makeOne()
29+
conn = self._make_one()
3030
URI = '/'.join([
3131
conn.API_BASE_URL,
3232
'bigquery',
@@ -38,7 +38,7 @@ def test_build_api_url_no_extra_query_params(self):
3838
def test_build_api_url_w_extra_query_params(self):
3939
from six.moves.urllib.parse import parse_qsl
4040
from six.moves.urllib.parse import urlsplit
41-
conn = self._makeOne()
41+
conn = self._make_one()
4242
uri = conn.build_api_url('/foo', {'bar': 'baz'})
4343
scheme, netloc, path, qs, _ = urlsplit(uri)
4444
self.assertEqual('%s://%s' % (scheme, netloc), conn.API_BASE_URL)

bigquery/unit_tests/test_client.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ def _get_target_class():
2222
from google.cloud.bigquery.client import Client
2323
return Client
2424

25-
def _makeOne(self, *args, **kw):
25+
def _make_one(self, *args, **kw):
2626
return self._get_target_class()(*args, **kw)
2727

2828
def test_ctor(self):
2929
from google.cloud.bigquery._http import Connection
3030
PROJECT = 'PROJECT'
3131
creds = _Credentials()
3232
http = object()
33-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
33+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
3434
self.assertIsInstance(client.connection, Connection)
3535
self.assertIs(client.connection.credentials, creds)
3636
self.assertIs(client.connection.http, http)
@@ -58,7 +58,7 @@ def test_list_projects_defaults(self):
5858
]
5959
}
6060
creds = _Credentials()
61-
client = self._makeOne(PROJECT_1, creds)
61+
client = self._make_one(PROJECT_1, creds)
6262
conn = client.connection = _Connection(DATA)
6363

6464
iterator = client.list_projects()
@@ -87,7 +87,7 @@ def test_list_projects_explicit_response_missing_projects_key(self):
8787
TOKEN = 'TOKEN'
8888
DATA = {}
8989
creds = _Credentials()
90-
client = self._makeOne(PROJECT, creds)
90+
client = self._make_one(PROJECT, creds)
9191
conn = client.connection = _Connection(DATA)
9292

9393
iterator = client.list_projects(max_results=3, page_token=TOKEN)
@@ -129,7 +129,7 @@ def test_list_datasets_defaults(self):
129129
]
130130
}
131131
creds = _Credentials()
132-
client = self._makeOne(PROJECT, creds)
132+
client = self._make_one(PROJECT, creds)
133133
conn = client.connection = _Connection(DATA)
134134

135135
iterator = client.list_datasets()
@@ -157,7 +157,7 @@ def test_list_datasets_explicit_response_missing_datasets_key(self):
157157
TOKEN = 'TOKEN'
158158
DATA = {}
159159
creds = _Credentials()
160-
client = self._makeOne(PROJECT, creds)
160+
client = self._make_one(PROJECT, creds)
161161
conn = client.connection = _Connection(DATA)
162162

163163
iterator = client.list_datasets(
@@ -182,7 +182,7 @@ def test_dataset(self):
182182
DATASET = 'dataset_name'
183183
creds = _Credentials()
184184
http = object()
185-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
185+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
186186
dataset = client.dataset(DATASET)
187187
self.assertIsInstance(dataset, Dataset)
188188
self.assertEqual(dataset.name, DATASET)
@@ -191,7 +191,7 @@ def test_dataset(self):
191191
def test_job_from_resource_unknown_type(self):
192192
PROJECT = 'PROJECT'
193193
creds = _Credentials()
194-
client = self._makeOne(PROJECT, creds)
194+
client = self._make_one(PROJECT, creds)
195195
with self.assertRaises(ValueError):
196196
client.job_from_resource({'configuration': {'nonesuch': {}}})
197197

@@ -305,7 +305,7 @@ def test_list_jobs_defaults(self):
305305
]
306306
}
307307
creds = _Credentials()
308-
client = self._makeOne(PROJECT, creds)
308+
client = self._make_one(PROJECT, creds)
309309
conn = client.connection = _Connection(DATA)
310310

311311
iterator = client.list_jobs()
@@ -361,7 +361,7 @@ def test_list_jobs_load_job_wo_sourceUris(self):
361361
]
362362
}
363363
creds = _Credentials()
364-
client = self._makeOne(PROJECT, creds)
364+
client = self._make_one(PROJECT, creds)
365365
conn = client.connection = _Connection(DATA)
366366

367367
iterator = client.list_jobs()
@@ -389,7 +389,7 @@ def test_list_jobs_explicit_missing(self):
389389
DATA = {}
390390
TOKEN = 'TOKEN'
391391
creds = _Credentials()
392-
client = self._makeOne(PROJECT, creds)
392+
client = self._make_one(PROJECT, creds)
393393
conn = client.connection = _Connection(DATA)
394394

395395
iterator = client.list_jobs(max_results=1000, page_token=TOKEN,
@@ -421,7 +421,7 @@ def test_load_table_from_storage(self):
421421
SOURCE_URI = 'http://example.com/source.csv'
422422
creds = _Credentials()
423423
http = object()
424-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
424+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
425425
dataset = client.dataset(DATASET)
426426
destination = dataset.table(DESTINATION)
427427
job = client.load_table_from_storage(JOB, destination, SOURCE_URI)
@@ -440,7 +440,7 @@ def test_copy_table(self):
440440
DESTINATION = 'destination_table'
441441
creds = _Credentials()
442442
http = object()
443-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
443+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
444444
dataset = client.dataset(DATASET)
445445
source = dataset.table(SOURCE)
446446
destination = dataset.table(DESTINATION)
@@ -460,7 +460,7 @@ def test_extract_table_to_storage(self):
460460
DESTINATION = 'gs://bucket_name/object_name'
461461
creds = _Credentials()
462462
http = object()
463-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
463+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
464464
dataset = client.dataset(DATASET)
465465
source = dataset.table(SOURCE)
466466
job = client.extract_table_to_storage(JOB, source, DESTINATION)
@@ -477,7 +477,7 @@ def test_run_async_query(self):
477477
QUERY = 'select count(*) from persons'
478478
creds = _Credentials()
479479
http = object()
480-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
480+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
481481
job = client.run_async_query(JOB, QUERY)
482482
self.assertIsInstance(job, QueryJob)
483483
self.assertIs(job._client, client)
@@ -490,7 +490,7 @@ def test_run_sync_query(self):
490490
QUERY = 'select count(*) from persons'
491491
creds = _Credentials()
492492
http = object()
493-
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
493+
client = self._make_one(project=PROJECT, credentials=creds, http=http)
494494
job = client.run_sync_query(QUERY)
495495
self.assertIsInstance(job, QueryResults)
496496
self.assertIs(job._client, client)

0 commit comments

Comments
 (0)