]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Replace assertEquals with assertEqual
authorZhongyue Luo <zhongyue.nah@intel.com>
Fri, 6 Sep 2013 07:27:20 +0000 (15:27 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Fri, 6 Sep 2013 08:19:07 +0000 (16:19 +0800)
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.

Fixes bug #1221601

Change-Id: Id502cfbc210c6c3fe0a256d5350e159ffa220141

neutron/tests/unit/test_iptables_manager.py
neutron/tests/unit/test_l3_agent.py

index 615a72c30f1e4eeff4f5616b58453673bf576b7e..0fda076770f67ef4363684dcfee4a35963c57955 100644 (file)
@@ -517,8 +517,8 @@ class IptablesManagerStateFulTestCase(base.BaseTestCase):
 
         self.mox.ReplayAll()
         acc = self.iptables.get_traffic_counters('OUTPUT')
-        self.assertEquals(acc['pkts'], 1600)
-        self.assertEquals(acc['bytes'], 263604)
+        self.assertEqual(acc['pkts'], 1600)
+        self.assertEqual(acc['bytes'], 263604)
 
         self.mox.VerifyAll()
 
@@ -548,8 +548,8 @@ class IptablesManagerStateFulTestCase(base.BaseTestCase):
 
         self.mox.ReplayAll()
         acc = self.iptables.get_traffic_counters('OUTPUT', zero=True)
-        self.assertEquals(acc['pkts'], 1600)
-        self.assertEquals(acc['bytes'], 263604)
+        self.assertEqual(acc['pkts'], 1600)
+        self.assertEqual(acc['bytes'], 263604)
 
         self.mox.VerifyAll()
 
index 844137db0e3c4c0d99dbbf1d6bb6e938448bf96c..010a2008447ccbfe106bf07c22374ab020e14cb0 100644 (file)
@@ -509,8 +509,8 @@ class TestBasicRouterOperations(base.BaseTestCase):
         for call in nat.mock_calls:
             name, args, kwargs = call
             if name == 'add_rule':
-                self.assertEquals(args, ('snat', '-j $float-snat'))
-                self.assertEquals(kwargs, {})
+                self.assertEqual(args, ('snat', '-j $float-snat'))
+                self.assertEqual(kwargs, {})
                 break
 
     def testRoutersWithAdminStateDown(self):