diff --git a/bigquery/tests/unit/test_dataset.py b/bigquery/tests/unit/test_dataset.py index 1f8580ebbcfd..8a34b82a460d 100644 --- a/bigquery/tests/unit/test_dataset.py +++ b/bigquery/tests/unit/test_dataset.py @@ -206,7 +206,7 @@ def _setUpConstants(self): self.DS_FULL_ID = '%s:%s' % (self.PROJECT, self.DS_ID) self.RESOURCE_URL = 'http://example.com/path/to/resource' - def _makeResource(self): + def _make_resource(self): self._setUpConstants() USER_EMAIL = 'phred@example.com' GROUP_EMAIL = 'group-name@lists.example.com' @@ -422,7 +422,7 @@ def test_from_api_repr_bare(self): self._verify_resource_properties(dataset, RESOURCE) def test_from_api_repr_w_properties(self): - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() klass = self._get_target_class() dataset = klass.from_api_repr(RESOURCE) self._verify_resource_properties(dataset, RESOURCE) diff --git a/bigquery/tests/unit/test_job.py b/bigquery/tests/unit/test_job.py index 4f94a1881a30..95000b24e8ea 100644 --- a/bigquery/tests/unit/test_job.py +++ b/bigquery/tests/unit/test_job.py @@ -114,7 +114,7 @@ def _table_ref(self, table_id): return TableReference(self.DS_REF, table_id) - def _makeResource(self, started=False, ended=False): + def _make_resource(self, started=False, ended=False): self._setUpConstants() resource = { 'configuration': { @@ -219,8 +219,8 @@ def _setUpConstants(self): self.OUTPUT_BYTES = 23456 self.OUTPUT_ROWS = 345 - def _makeResource(self, started=False, ended=False): - resource = super(TestLoadJob, self)._makeResource( + def _make_resource(self, started=False, ended=False): + resource = super(TestLoadJob, self)._make_resource( started, ended) config = resource['configuration']['load'] config['sourceUris'] = [self.SOURCE1] @@ -374,13 +374,13 @@ def test_ctor_w_config(self): def test_done(self): client = _make_client(project=self.PROJECT) - resource = self._makeResource(ended=True) + resource = self._make_resource(ended=True) job = self._get_target_class().from_api_repr(resource, client) self.assertTrue(job.done()) def test_result(self): client = _make_client(project=self.PROJECT) - resource = self._makeResource(ended=True) + resource = self._make_resource(ended=True) job = self._get_target_class().from_api_repr(resource, client) result = job.result() @@ -388,7 +388,7 @@ def test_result(self): self.assertIs(result, job) def test_result_invokes_begin(self): - begun_resource = self._makeResource() + begun_resource = self._make_resource() done_resource = copy.deepcopy(begun_resource) done_resource['status'] = {'state': 'DONE'} connection = _Connection(begun_resource, done_resource) @@ -537,7 +537,7 @@ def test_from_api_repr_bare(self): def test_from_api_repr_w_properties(self): client = _make_client(project=self.PROJECT) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() load_config = RESOURCE['configuration']['load'] load_config['createDisposition'] = 'CREATE_IF_NEEDED' klass = self._get_target_class() @@ -557,7 +557,7 @@ def test_begin_w_already_running(self): def test_begin_w_bound_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -595,7 +595,7 @@ def test_begin_w_bound_client(self): def test_begin_w_autodetect(self): path = '/projects/{}/jobs'.format(self.PROJECT) - resource = self._makeResource() + resource = self._make_resource() resource['configuration']['load']['autodetect'] = True # Ensure None for missing server-set props del resource['statistics']['creationTime'] @@ -639,7 +639,7 @@ def test_begin_w_alternate_client(self): from google.cloud.bigquery.schema import SchemaField PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) LOAD_CONFIGURATION = { 'sourceUris': [self.SOURCE1], 'destinationTable': { @@ -743,7 +743,7 @@ def test_exists_hit_w_alternate_client(self): def test_reload_w_bound_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _make_client(project=self.PROJECT, connection=conn) table = _Table() @@ -759,7 +759,7 @@ def test_reload_w_bound_client(self): def test_reload_w_alternate_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn1 = _Connection() client1 = _make_client(project=self.PROJECT, connection=conn1) conn2 = _Connection(RESOURCE) @@ -778,7 +778,7 @@ def test_reload_w_alternate_client(self): def test_cancel_w_bound_client(self): PATH = '/projects/%s/jobs/%s/cancel' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) RESPONSE = {'job': RESOURCE} conn = _Connection(RESPONSE) client = _make_client(project=self.PROJECT, connection=conn) @@ -795,7 +795,7 @@ def test_cancel_w_bound_client(self): def test_cancel_w_alternate_client(self): PATH = '/projects/%s/jobs/%s/cancel' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) RESPONSE = {'job': RESOURCE} conn1 = _Connection() client1 = _make_client(project=self.PROJECT, connection=conn1) @@ -825,8 +825,8 @@ def _get_target_class(): return CopyJob - def _makeResource(self, started=False, ended=False): - resource = super(TestCopyJob, self)._makeResource( + def _make_resource(self, started=False, ended=False): + resource = super(TestCopyJob, self)._make_resource( started, ended) config = resource['configuration']['copy'] config['sourceTables'] = [{ @@ -997,7 +997,7 @@ def test_from_api_repr_wo_sources(self): def test_from_api_repr_w_properties(self): client = _make_client(project=self.PROJECT) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() copy_config = RESOURCE['configuration']['copy'] copy_config['createDisposition'] = 'CREATE_IF_NEEDED' klass = self._get_target_class() @@ -1007,7 +1007,7 @@ def test_from_api_repr_w_properties(self): def test_begin_w_bound_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -1050,7 +1050,7 @@ def test_begin_w_bound_client(self): def test_begin_w_alternate_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) COPY_CONFIGURATION = { 'sourceTables': [{ 'projectId': self.PROJECT, @@ -1134,7 +1134,7 @@ def test_exists_hit_w_alternate_client(self): def test_reload_w_bound_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _make_client(project=self.PROJECT, connection=conn) source = self._table_ref(self.SOURCE_TABLE) @@ -1151,7 +1151,7 @@ def test_reload_w_bound_client(self): def test_reload_w_alternate_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn1 = _Connection() client1 = _make_client(project=self.PROJECT, connection=conn1) conn2 = _Connection(RESOURCE) @@ -1181,8 +1181,8 @@ def _get_target_class(): return ExtractJob - def _makeResource(self, started=False, ended=False): - resource = super(TestExtractJob, self)._makeResource( + def _make_resource(self, started=False, ended=False): + resource = super(TestExtractJob, self)._make_resource( started, ended) config = resource['configuration']['extract'] config['sourceTable'] = { @@ -1316,7 +1316,7 @@ def test_from_api_repr_bare(self): def test_from_api_repr_w_properties(self): client = _make_client(project=self.PROJECT) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() extract_config = RESOURCE['configuration']['extract'] extract_config['compression'] = 'GZIP' klass = self._get_target_class() @@ -1326,7 +1326,7 @@ def test_from_api_repr_w_properties(self): def test_begin_w_bound_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -1366,7 +1366,7 @@ def test_begin_w_bound_client(self): def test_begin_w_alternate_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) EXTRACT_CONFIGURATION = { 'sourceTable': { 'projectId': self.PROJECT, @@ -1450,7 +1450,7 @@ def test_exists_hit_w_alternate_client(self): def test_reload_w_bound_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _make_client(project=self.PROJECT, connection=conn) source_dataset = DatasetReference(self.PROJECT, self.DS_ID) @@ -1468,7 +1468,7 @@ def test_reload_w_bound_client(self): def test_reload_w_alternate_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn1 = _Connection() client1 = _make_client(project=self.PROJECT, connection=conn1) conn2 = _Connection(RESOURCE) @@ -1562,8 +1562,8 @@ def _get_target_class(): return QueryJob - def _makeResource(self, started=False, ended=False): - resource = super(TestQueryJob, self)._makeResource( + def _make_resource(self, started=False, ended=False): + resource = super(TestQueryJob, self)._make_resource( started, ended) config = resource['configuration']['query'] config['query'] = self.QUERY @@ -1788,7 +1788,7 @@ def test_from_api_repr_bare(self): def test_from_api_repr_w_properties(self): client = _make_client(project=self.PROJECT) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() query_config = RESOURCE['configuration']['query'] query_config['createDisposition'] = 'CREATE_IF_NEEDED' query_config['writeDisposition'] = 'WRITE_TRUNCATE' @@ -1816,7 +1816,7 @@ def test_cancelled(self): def test_done(self): client = _make_client(project=self.PROJECT) - resource = self._makeResource(ended=True) + resource = self._make_resource(ended=True) job = self._get_target_class().from_api_repr(resource, client) self.assertTrue(job.done()) @@ -2137,7 +2137,7 @@ def test_result(self): } connection = _Connection(query_resource, query_resource) client = _make_client(self.PROJECT, connection=connection) - resource = self._makeResource(ended=True) + resource = self._make_resource(ended=True) job = self._get_target_class().from_api_repr(resource, client) result = job.result() @@ -2145,7 +2145,7 @@ def test_result(self): self.assertEqual(list(result), []) def test_result_invokes_begins(self): - begun_resource = self._makeResource() + begun_resource = self._make_resource() incomplete_resource = { 'jobComplete': False, 'jobReference': { @@ -2172,7 +2172,7 @@ def test_result_invokes_begins(self): self.assertEqual(reload_request['method'], 'GET') def test_result_w_timeout(self): - begun_resource = self._makeResource() + begun_resource = self._make_resource() query_resource = { 'jobComplete': True, 'jobReference': { @@ -2229,7 +2229,7 @@ def test_begin_w_bound_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) DS_ID = 'DATASET' - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2277,7 +2277,7 @@ def test_begin_w_alternate_client(self): PATH = '/projects/%s/jobs' % (self.PROJECT,) TABLE = 'TABLE' DS_ID = 'DATASET' - RESOURCE = self._makeResource(ended=True) + RESOURCE = self._make_resource(ended=True) QUERY_CONFIGURATION = { 'query': self.QUERY, 'allowLargeResults': True, @@ -2351,7 +2351,7 @@ def test_begin_w_udf(self): RESOURCE_URI = 'gs://some-bucket/js/lib.js' INLINE_UDF_CODE = 'var someCode = "here";' PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2405,7 +2405,7 @@ def test_begin_w_named_query_parameter(self): query_parameters = [ScalarQueryParameter('foo', 'INT64', 123)] PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2461,7 +2461,7 @@ def test_begin_w_positional_query_parameter(self): query_parameters = [ScalarQueryParameter.positional('INT64', 123)] PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2517,7 +2517,7 @@ def test_begin_w_table_defs(self): from google.cloud.bigquery.external_config import BigtableColumnFamily PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2601,7 +2601,7 @@ def test_dry_run_query(self): from google.cloud.bigquery.job import QueryJobConfig PATH = '/projects/%s/jobs' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() # Ensure None for missing server-set props del RESOURCE['statistics']['creationTime'] del RESOURCE['etag'] @@ -2675,7 +2675,7 @@ def test_reload_w_bound_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) DS_ID = 'DATASET' DEST_TABLE = 'dest_table' - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _make_client(project=self.PROJECT, connection=conn) dataset_ref = DatasetReference(self.PROJECT, DS_ID) @@ -2698,7 +2698,7 @@ def test_reload_w_alternate_client(self): PATH = '/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_ID) DS_ID = 'DATASET' DEST_TABLE = 'dest_table' - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() q_config = RESOURCE['configuration']['query'] q_config['destinationTable'] = { 'projectId': self.PROJECT, diff --git a/bigquery/tests/unit/test_query.py b/bigquery/tests/unit/test_query.py index 1924d55c9959..35def936946b 100644 --- a/bigquery/tests/unit/test_query.py +++ b/bigquery/tests/unit/test_query.py @@ -987,7 +987,7 @@ def _get_target_class(): def _make_one(self, *args, **kw): return self._get_target_class()(*args, **kw) - def _makeResource(self): + def _make_resource(self): return { 'jobReference': { 'projectId': self.PROJECT, @@ -1013,7 +1013,7 @@ def _verifySchema(self, query, resource): self.assertEqual(query.schema, ()) def test_ctor_defaults(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.cache_hit) self.assertIsNone(query.complete) self.assertIsNone(query.errors) @@ -1025,34 +1025,34 @@ def test_ctor_defaults(self): self.assertIsNone(query.total_bytes_processed) def test_cache_hit_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.cache_hit) def test_cache_hit_present(self): - resource = self._makeResource() + resource = self._make_resource() resource['cacheHit'] = True query = self._make_one(resource) self.assertTrue(query.cache_hit) def test_complete_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.complete) def test_complete_present(self): - resource = self._makeResource() + resource = self._make_resource() resource['jobComplete'] = True query = self._make_one(resource) self.assertTrue(query.complete) def test_errors_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.errors) def test_errors_present(self): ERRORS = [ {'reason': 'testing'}, ] - resource = self._makeResource() + resource = self._make_resource() resource['errors'] = ERRORS query = self._make_one(resource) self.assertEqual(query.errors, ERRORS) @@ -1067,69 +1067,69 @@ def test_job_id_broken_job_reference(self): self._make_one(resource) def test_job_id_present(self): - resource = self._makeResource() + resource = self._make_resource() resource['jobReference']['jobId'] = 'custom-job' query = self._make_one(resource) self.assertEqual(query.job_id, 'custom-job') def test_page_token_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.page_token) def test_page_token_present(self): - resource = self._makeResource() + resource = self._make_resource() resource['pageToken'] = 'TOKEN' query = self._make_one(resource) self.assertEqual(query.page_token, 'TOKEN') def test_total_rows_present_integer(self): - resource = self._makeResource() + resource = self._make_resource() resource['totalRows'] = 42 query = self._make_one(resource) self.assertEqual(query.total_rows, 42) def test_total_rows_present_string(self): - resource = self._makeResource() + resource = self._make_resource() resource['totalRows'] = '42' query = self._make_one(resource) self.assertEqual(query.total_rows, 42) def test_total_bytes_processed_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.total_bytes_processed) def test_total_bytes_processed_present_integer(self): - resource = self._makeResource() + resource = self._make_resource() resource['totalBytesProcessed'] = 123456 query = self._make_one(resource) self.assertEqual(query.total_bytes_processed, 123456) def test_total_bytes_processed_present_string(self): - resource = self._makeResource() + resource = self._make_resource() resource['totalBytesProcessed'] = '123456' query = self._make_one(resource) self.assertEqual(query.total_bytes_processed, 123456) def test_num_dml_affected_rows_missing(self): - query = self._make_one(self._makeResource()) + query = self._make_one(self._make_resource()) self.assertIsNone(query.num_dml_affected_rows) def test_num_dml_affected_rows_present_integer(self): - resource = self._makeResource() + resource = self._make_resource() resource['numDmlAffectedRows'] = 123456 query = self._make_one(resource) self.assertEqual(query.num_dml_affected_rows, 123456) def test_num_dml_affected_rows_present_string(self): - resource = self._makeResource() + resource = self._make_resource() resource['numDmlAffectedRows'] = '123456' query = self._make_one(resource) self.assertEqual(query.num_dml_affected_rows, 123456) def test_schema(self): - query = self._make_one(self._makeResource()) - self._verifySchema(query, self._makeResource()) - resource = self._makeResource() + query = self._make_one(self._make_resource()) + self._verifySchema(query, self._make_resource()) + resource = self._make_resource() resource['schema'] = { 'fields': [ {'name': 'full_name', 'type': 'STRING', 'mode': 'REQURED'}, diff --git a/bigquery/tests/unit/test_schema.py b/bigquery/tests/unit/test_schema.py index e9c13f75ea3d..a5d5ecacd619 100644 --- a/bigquery/tests/unit/test_schema.py +++ b/bigquery/tests/unit/test_schema.py @@ -261,7 +261,7 @@ def _call_fut(self, resource): return _parse_schema_resource(resource) - def _makeResource(self): + def _make_resource(self): return { 'schema': {'fields': [ {'name': 'full_name', 'type': 'STRING', 'mode': 'REQUIRED'}, @@ -270,12 +270,12 @@ def _makeResource(self): } def test__parse_schema_resource_defaults(self): - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() schema = self._call_fut(RESOURCE['schema']) self._verifySchema(schema, RESOURCE) def test__parse_schema_resource_subfields(self): - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() RESOURCE['schema']['fields'].append( {'name': 'phone', 'type': 'RECORD', @@ -290,7 +290,7 @@ def test__parse_schema_resource_subfields(self): self._verifySchema(schema, RESOURCE) def test__parse_schema_resource_fields_without_mode(self): - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() RESOURCE['schema']['fields'].append( {'name': 'phone', 'type': 'STRING'}) diff --git a/bigquery/tests/unit/test_table.py b/bigquery/tests/unit/test_table.py index 9bdd62c7404e..888974c3cdaf 100644 --- a/bigquery/tests/unit/test_table.py +++ b/bigquery/tests/unit/test_table.py @@ -177,7 +177,7 @@ def _setUpConstants(self): self.NUM_EST_BYTES = 1234 self.NUM_EST_ROWS = 23 - def _makeResource(self): + def _make_resource(self): self._setUpConstants() return { 'creationTime': self.WHEN_TS * 1000, @@ -576,7 +576,7 @@ def test_from_api_repr_w_properties(self): from google.cloud._helpers import UTC from google.cloud._helpers import _millis - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() RESOURCE['view'] = {'query': 'select fullname, age from person_ages'} RESOURCE['type'] = 'VIEW' RESOURCE['location'] = 'EU' diff --git a/dns/tests/unit/test_changes.py b/dns/tests/unit/test_changes.py index cc92973da9e7..ffe76081a2c7 100644 --- a/dns/tests/unit/test_changes.py +++ b/dns/tests/unit/test_changes.py @@ -35,7 +35,7 @@ def _setUpConstants(self): self.WHEN = _NOW().replace(tzinfo=UTC) - def _makeResource(self): + def _make_resource(self): from google.cloud._helpers import _datetime_to_rfc3339 when_str = _datetime_to_rfc3339(self.WHEN) @@ -98,7 +98,7 @@ def test_ctor(self): def test_from_api_repr_missing_additions_deletions(self): self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() del RESOURCE['additions'] del RESOURCE['deletions'] zone = _Zone() @@ -110,7 +110,7 @@ def test_from_api_repr_missing_additions_deletions(self): def test_from_api_repr(self): self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() zone = _Zone() klass = self._get_target_class() @@ -166,7 +166,7 @@ def test_delete_record_set(self): def test_create_wo_additions_or_deletions(self): self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _Client(project=self.PROJECT, connection=conn) zone = _Zone(client) @@ -181,7 +181,7 @@ def test_create_w_bound_client(self): from google.cloud.dns.resource_record_set import ResourceRecordSet self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() PATH = 'projects/%s/managedZones/%s/changes' % ( self.PROJECT, self.ZONE_NAME) conn = _Connection(RESOURCE) @@ -210,7 +210,7 @@ def test_create_w_alternate_client(self): from google.cloud.dns.resource_record_set import ResourceRecordSet self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() PATH = 'projects/%s/managedZones/%s/changes' % ( self.PROJECT, self.ZONE_NAME) conn1 = _Connection() @@ -280,7 +280,7 @@ def test_reload_w_bound_client(self): PATH = 'projects/%s/managedZones/%s/changes/%s' % ( self.PROJECT, self.ZONE_NAME, self.CHANGES_NAME) self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _Client(project=self.PROJECT, connection=conn) zone = _Zone(client) @@ -299,7 +299,7 @@ def test_reload_w_alternate_client(self): PATH = 'projects/%s/managedZones/%s/changes/%s' % ( self.PROJECT, self.ZONE_NAME, self.CHANGES_NAME) self._setUpConstants() - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn1 = _Connection() client1 = _Client(project=self.PROJECT, connection=conn1) conn2 = _Connection(RESOURCE) diff --git a/dns/tests/unit/test_zone.py b/dns/tests/unit/test_zone.py index 380c5f5d81db..c581745c328d 100644 --- a/dns/tests/unit/test_zone.py +++ b/dns/tests/unit/test_zone.py @@ -48,7 +48,7 @@ def _setUpConstants(self): year, month, day, hour, minute, seconds, micros, tzinfo=UTC) self.ZONE_ID = 12345 - def _makeResource(self): + def _make_resource(self): self._setUpConstants() return { 'name': self.ZONE_NAME, @@ -153,7 +153,7 @@ def test_from_api_repr_bare(self): def test_from_api_repr_w_properties(self): self._setUpConstants() client = _Client(self.PROJECT) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() klass = self._get_target_class() zone = klass.from_api_repr(RESOURCE, client=client) self.assertIs(zone._client, client) @@ -211,7 +211,7 @@ def test_changes(self): def test_create_w_bound_client(self): PATH = 'projects/%s/managedZones' % self.PROJECT - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _Client(project=self.PROJECT, connection=conn) zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) @@ -234,7 +234,7 @@ def test_create_w_alternate_client(self): PATH = 'projects/%s/managedZones' % self.PROJECT DESCRIPTION = 'DESCRIPTION' NAME_SERVER_SET = 'NAME_SERVER_SET' - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() RESOURCE['nameServerSet'] = NAME_SERVER_SET RESOURCE['description'] = DESCRIPTION conn1 = _Connection() @@ -293,7 +293,7 @@ def test_create_w_missing_output_properties(self): # In the wild, the resource returned from 'zone.create' sometimes # lacks 'creationTime' / 'lastModifiedTime' PATH = 'projects/%s/managedZones' % (self.PROJECT,) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() del RESOURCE['creationTime'] del RESOURCE['id'] del RESOURCE['nameServers'] @@ -349,7 +349,7 @@ def test_exists_hit_w_alternate_client(self): def test_reload_w_bound_client(self): PATH = 'projects/%s/managedZones/%s' % (self.PROJECT, self.ZONE_NAME) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn = _Connection(RESOURCE) client = _Client(project=self.PROJECT, connection=conn) zone = self._make_one(self.ZONE_NAME, client=client) @@ -366,7 +366,7 @@ def test_reload_w_bound_client(self): def test_reload_w_alternate_client(self): PATH = 'projects/%s/managedZones/%s' % (self.PROJECT, self.ZONE_NAME) - RESOURCE = self._makeResource() + RESOURCE = self._make_resource() conn1 = _Connection() client1 = _Client(project=self.PROJECT, connection=conn1) conn2 = _Connection(RESOURCE)