Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename deprecated assertEquals to assertEqual. #3043

Merged
merged 1 commit into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions error_reporting/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ def _makeHTTP(self, *args, **kw):
def test_ctor_default(self, _):
CREDENTIALS = _make_credentials()
target = self._make_one(credentials=CREDENTIALS)
self.assertEquals(target.service, target.DEFAULT_SERVICE)
self.assertEquals(target.version, None)
self.assertEqual(target.service, target.DEFAULT_SERVICE)
self.assertEqual(target.version, None)

def test_ctor_params(self):
CREDENTIALS = _make_credentials()
target = self._make_one(project=self.PROJECT,
credentials=CREDENTIALS,
service=self.SERVICE,
version=self.VERSION)
self.assertEquals(target.service, self.SERVICE)
self.assertEquals(target.version, self.VERSION)
self.assertEqual(target.service, self.SERVICE)
self.assertEqual(target.version, self.VERSION)

def test_report_exception_with_gax(self):
CREDENTIALS = _make_credentials()
Expand All @@ -77,7 +77,7 @@ def test_report_exception_with_gax(self):
except NameError:
target.report_exception()
payload = make_api.return_value.report_error_event.call_args[0][0]
self.assertEquals(payload['serviceContext'], {
self.assertEqual(payload['serviceContext'], {
'service': target.DEFAULT_SERVICE,
})
self.assertIn('test_report', payload['message'])
Expand All @@ -99,7 +99,7 @@ def test_report_exception_wo_gax(self):
mock_report = _error_api.return_value.report_error_event
payload = mock_report.call_args[0][0]

self.assertEquals(payload['serviceContext'], {
self.assertEqual(payload['serviceContext'], {
'service': target.DEFAULT_SERVICE,
})
self.assertIn('test_report', payload['message'])
Expand Down Expand Up @@ -129,19 +129,19 @@ def test_report_exception_with_service_version_in_constructor(
target.report_exception(http_context=http_context, user=USER)

payload = client.report_error_event.call_args[0][0]
self.assertEquals(payload['serviceContext'], {
self.assertEqual(payload['serviceContext'], {
'service': SERVICE,
'version': VERSION
})
self.assertIn(
'test_report_exception_with_service_version_in_constructor',
payload['message'])
self.assertIn('test_client.py', payload['message'])
self.assertEquals(
self.assertEqual(
payload['context']['httpContext']['responseStatusCode'], 500)
self.assertEquals(
self.assertEqual(
payload['context']['httpContext']['method'], 'GET')
self.assertEquals(payload['context']['user'], USER)
self.assertEqual(payload['context']['user'], USER)

@mock.patch('google.cloud.error_reporting.client.make_report_error_api')
def test_report(self, make_client):
Expand All @@ -157,7 +157,7 @@ def test_report(self, make_client):

payload = client.report_error_event.call_args[0][0]

self.assertEquals(payload['message'], MESSAGE)
self.assertEqual(payload['message'], MESSAGE)
report_location = payload['context']['reportLocation']
self.assertIn('test_client.py', report_location['filePath'])
self.assertEqual(report_location['functionName'], 'test_report')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_ctor(self):
client = _Client(self.PROJECT)
NAME = 'python_logger'
transport = self._make_one(client, NAME)
self.assertEquals(transport.worker.logger.name, NAME)
self.assertEqual(transport.worker.logger.name, NAME)

def test_send(self):
client = _Client(self.PROJECT)
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_ctor(self):
NAME = 'python_logger'
logger = _Logger(NAME)
worker = self._make_one(logger)
self.assertEquals(worker.batch, logger._batch)
self.assertEqual(worker.batch, logger._batch)

def test_run(self):
NAME = 'python_logger'
Expand Down
2 changes: 1 addition & 1 deletion monitoring/unit_tests/test_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def test_to_dict(self):
'type': TYPE,
'labels': LABELS,
}
self.assertEquals(metric._to_dict(), expected_dict)
self.assertEqual(metric._to_dict(), expected_dict)


class _Connection(object):
Expand Down
2 changes: 1 addition & 1 deletion monitoring/unit_tests/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_to_dict(self):
'type': TYPE,
'labels': LABELS,
}
self.assertEquals(resource._to_dict(), expected_dict)
self.assertEqual(resource._to_dict(), expected_dict)


class _Connection(object):
Expand Down