From 4c3f070eebd3e3a72d675a82e742b2b7b631a1e6 Mon Sep 17 00:00:00 2001 From: Van Hung Pham Date: Fri, 16 Jun 2017 10:45:08 +0700 Subject: [PATCH] Replace assertEquals with assertEqual The method assertEquals has been deprecated since python 2.7. http://docs.python.org/2/library/unittest.html#deprecated-aliases Also in Python 3, a deprecated warning is raised when using assertEquals therefore we should use assertEqual instead. Change-Id: I7410c0290403484aec621363661b9e12836a407a --- distil/tests/unit/service/test_collector.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/distil/tests/unit/service/test_collector.py b/distil/tests/unit/service/test_collector.py index 6b3e5d9..cc10599 100644 --- a/distil/tests/unit/service/test_collector.py +++ b/distil/tests/unit/service/test_collector.py @@ -91,13 +91,13 @@ class CollectorTest(base.DistilWithDbTestCase): resources = db_api.resource_get_by_ids(project_id, [resource_id_hash]) res_info = json.loads(resources[0].info) - self.assertEquals(1, len(resources)) - self.assertEquals(container_name, res_info['name']) + self.assertEqual(1, len(resources)) + self.assertEqual(container_name, res_info['name']) entries = db_api.usage_get(project_id, start_time, end_time) - self.assertEquals(1, len(entries)) - self.assertEquals(resource_id_hash, entries[0].resource_id) + self.assertEqual(1, len(entries)) + self.assertEqual(resource_id_hash, entries[0].resource_id) @mock.patch( 'distil.collector.ceilometer.CeilometerCollector.collect_usage')