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.

Change-Id: Iba0ae72e72470cdf5b122defcd68effc5434f948
This commit is contained in:
Zhongyue Luo 2013-10-11 11:30:24 +08:00
parent 0b8f688efd
commit c59e04fbfa
5 changed files with 7 additions and 7 deletions

View File

@ -238,8 +238,8 @@ class TestSerializer(test_utils.BaseTestCase):
'timestamp': str(timeutils.utcnow.override_time),
}
self.assertEquals(_impl_test.NOTIFICATIONS,
[(dict(user='alice'), message, 'INFO')])
self.assertEqual(_impl_test.NOTIFICATIONS,
[(dict(user='alice'), message, 'INFO')])
class TestLogNotifier(test_utils.BaseTestCase):

View File

@ -118,7 +118,7 @@ class PoolTestCase(test_utils.BaseTestCase):
self.assertIn(o, objs)
objs.remove(o)
self.assertEquals(objs, [])
self.assertEqual(objs, [])
PoolTestCase.generate_scenarios()

View File

@ -100,7 +100,7 @@ class TestRabbitTransportURL(test_utils.BaseTestCase):
driver.listen(target)
self.assertEquals(passed_params[0], self.expected)
self.assertEqual(passed_params[0], self.expected)
class TestSendReceive(test_utils.BaseTestCase):

View File

@ -288,7 +288,7 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin):
client.call({}, 'ping', arg='foo')
except Exception as ex:
self.assertIsInstance(ex, ValueError)
self.assertEquals(ex[0], 'dsfoo')
self.assertEqual(ex[0], 'dsfoo')
else:
self.assertTrue(False)
@ -309,7 +309,7 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin):
client.call({}, 'ping', arg='foo')
except Exception as ex:
self.assertIsInstance(ex, ValueError)
self.assertEquals(ex[0], 'dsfoo')
self.assertEqual(ex[0], 'dsfoo')
else:
self.assertTrue(False)

View File

@ -170,7 +170,7 @@ class EqualityTestCase(test_utils.BaseTestCase):
self.assertEqual(a, b)
self.assertFalse(a != b)
else:
self.assertNotEquals(a, b)
self.assertNotEqual(a, b)
self.assertFalse(a == b)