diff --git a/neutron/tests/unit/nicira/test_nicira_plugin.py b/neutron/tests/unit/nicira/test_nicira_plugin.py index 57ea077a0..bea46b64b 100644 --- a/neutron/tests/unit/nicira/test_nicira_plugin.py +++ b/neutron/tests/unit/nicira/test_nicira_plugin.py @@ -589,14 +589,14 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, device_owner='network:dhcp'): subnets = self._list('subnets')['subnets'] self.assertEqual(len(subnets), 1) - self.assertEquals(subnets[0]['host_routes'][0]['nexthop'], - '10.0.0.2') - self.assertEquals(subnets[0]['host_routes'][0]['destination'], - '169.254.169.254/32') + self.assertEqual(subnets[0]['host_routes'][0]['nexthop'], + '10.0.0.2') + self.assertEqual(subnets[0]['host_routes'][0]['destination'], + '169.254.169.254/32') subnets = self._list('subnets')['subnets'] # Test that route is deleted after dhcp port is removed - self.assertEquals(len(subnets[0]['host_routes']), 0) + self.assertEqual(len(subnets[0]['host_routes']), 0) def test_floatingip_disassociate(self): with self.port() as p: diff --git a/neutron/tests/unit/openvswitch/test_ovs_db.py b/neutron/tests/unit/openvswitch/test_ovs_db.py index 0d0a79b54..d16bf0ae4 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_db.py +++ b/neutron/tests/unit/openvswitch/test_ovs_db.py @@ -233,10 +233,10 @@ class TunnelAllocationsTest(base.BaseTestCase): def test_add_tunnel_endpoints(self): tun_1 = ovs_db_v2.add_tunnel_endpoint('192.168.0.1') tun_2 = ovs_db_v2.add_tunnel_endpoint('192.168.0.2') - self.assertEquals(1, tun_1.id) - self.assertEquals('192.168.0.1', tun_1.ip_address) - self.assertEquals(2, tun_2.id) - self.assertEquals('192.168.0.2', tun_2.ip_address) + self.assertEqual(1, tun_1.id) + self.assertEqual('192.168.0.1', tun_1.ip_address) + self.assertEqual(2, tun_2.id) + self.assertEqual('192.168.0.2', tun_2.ip_address) def test_specific_tunnel_inside_pool(self): tunnel_id = TUN_MIN + 5 diff --git a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py index 32ad18bdb..d7c0deb98 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py @@ -370,7 +370,7 @@ class TestOvsNeutronAgent(base.BaseTestCase): root_helper='sudo') version_ok = True except SystemExit as e: - self.assertEquals(e.code, 1) + self.assertEqual(e.code, 1) version_ok = False self.assertEqual(version_ok, expecting_ok) diff --git a/neutron/tests/unit/services/firewall/test_fwaas_plugin.py b/neutron/tests/unit/services/firewall/test_fwaas_plugin.py index 5b484f1e1..eda0e56de 100644 --- a/neutron/tests/unit/services/firewall/test_fwaas_plugin.py +++ b/neutron/tests/unit/services/firewall/test_fwaas_plugin.py @@ -350,4 +350,4 @@ class TestFirewallPluginBase(test_db_firewall.TestFirewallDBPlugin): with self.firewall(no_delete=True) as fw: fw_id = fw['firewall']['id'] fw_rules = self.plugin._make_firewall_dict_with_rules(ctx, fw_id) - self.assertEquals(fw_rules['firewall_rule_list'], []) + self.assertEqual(fw_rules['firewall_rule_list'], []) diff --git a/neutron/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py index 668ce5388..160dd8214 100644 --- a/neutron/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -3040,10 +3040,10 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase): req = self.new_update_request('subnets', data, res['subnet']['id']) res = self.deserialize(self.fmt, req.get_response(self.api)) - self.assertEquals(sorted(res['subnet']['host_routes']), - sorted(host_routes)) - self.assertEquals(sorted(res['subnet']['dns_nameservers']), - sorted(dns_nameservers)) + self.assertEqual(sorted(res['subnet']['host_routes']), + sorted(host_routes)) + self.assertEqual(sorted(res['subnet']['dns_nameservers']), + sorted(dns_nameservers)) def test_update_subnet_shared_returns_400(self): with self.network(shared=True) as network: diff --git a/neutron/tests/unit/test_dhcp_agent.py b/neutron/tests/unit/test_dhcp_agent.py index e2ae37d91..675bda03f 100644 --- a/neutron/tests/unit/test_dhcp_agent.py +++ b/neutron/tests/unit/test_dhcp_agent.py @@ -369,7 +369,7 @@ class TestDhcpAgent(base.BaseTestCase): cfg.CONF.root_helper ) - self.assertEquals(set(networks), set(dhcp.cache.get_network_ids())) + self.assertEqual(set(networks), set(dhcp.cache.get_network_ids())) class TestLogArgs(base.BaseTestCase): diff --git a/neutron/tests/unit/test_extension_security_group.py b/neutron/tests/unit/test_extension_security_group.py index a0d397963..05c3389ad 100644 --- a/neutron/tests/unit/test_extension_security_group.py +++ b/neutron/tests/unit/test_extension_security_group.py @@ -170,7 +170,7 @@ class SecurityGroupsTestCase(test_db_plugin.NeutronDbPluginV2TestCase): in as expected_kvs dictionary """ for k, v in expected_kvs.iteritems(): - self.assertEquals(security_group_rule[k], v) + self.assertEqual(security_group_rule[k], v) class SecurityGroupsTestCaseXML(SecurityGroupsTestCase): @@ -257,10 +257,10 @@ class TestSecurityGroups(SecurityGroupDBTestCase): # Verify that default egress rules have been created sg_rules = security_group['security_group']['security_group_rules'] - self.assertEquals(len(sg_rules), 2) + self.assertEqual(len(sg_rules), 2) v4_rules = filter(lambda x: x['ethertype'] == 'IPv4', sg_rules) - self.assertEquals(len(v4_rules), 1) + self.assertEqual(len(v4_rules), 1) v4_rule = v4_rules[0] expected = {'direction': 'egress', 'ethertype': 'IPv4', @@ -272,7 +272,7 @@ class TestSecurityGroups(SecurityGroupDBTestCase): self._assert_sg_rule_has_kvs(v4_rule, expected) v6_rules = filter(lambda x: x['ethertype'] == 'IPv6', sg_rules) - self.assertEquals(len(v6_rules), 1) + self.assertEqual(len(v6_rules), 1) v6_rule = v6_rules[0] expected = {'direction': 'egress', 'ethertype': 'IPv6', diff --git a/neutron/tests/unit/test_l3_plugin.py b/neutron/tests/unit/test_l3_plugin.py index 105b9f2f4..2145b6e63 100644 --- a/neutron/tests/unit/test_l3_plugin.py +++ b/neutron/tests/unit/test_l3_plugin.py @@ -665,7 +665,7 @@ class L3NatDBTestCase(L3NatTestCaseBase): if n['event_type'].startswith('router.interface.'): payload = n['payload']['router.interface'] self.assertIn('id', payload) - self.assertEquals(payload['id'], r['router']['id']) + self.assertEqual(payload['id'], r['router']['id']) self.assertIn('tenant_id', payload) stid = s['subnet']['tenant_id'] # tolerate subnet tenant deliberately to '' in the diff --git a/neutron/tests/unit/test_linux_dhcp.py b/neutron/tests/unit/test_linux_dhcp.py index f161b5770..22850b42e 100644 --- a/neutron/tests/unit/test_linux_dhcp.py +++ b/neutron/tests/unit/test_linux_dhcp.py @@ -790,8 +790,8 @@ tag:tag1,249,%s,%s""".lstrip() % (fake_v6, result = dhcp.Dnsmasq.existing_dhcp_networks(self.conf, 'sudo') mock_listdir.assert_called_once_with(path) - self.assertEquals(['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'], - result) + self.assertEqual(['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'], + result) def _check_version(self, cmd_out, expected_value): with mock.patch('neutron.agent.linux.utils.execute') as cmd: diff --git a/neutron/tests/unit/test_linux_interface.py b/neutron/tests/unit/test_linux_interface.py index a9bd27100..3ca628d74 100644 --- a/neutron/tests/unit/test_linux_interface.py +++ b/neutron/tests/unit/test_linux_interface.py @@ -386,14 +386,14 @@ class TestMetaInterfaceDriver(TestBase): namespace=None) expected = [mock.call('tap0', 'sudo', None)] self.ip_dev.assert_has_calls(expected) - self.assertEquals('fake1', plugin_tag0) + self.assertEqual('fake1', plugin_tag0) namespace = '01234567-1234-1234-99' expected = [mock.call('tap1', 'sudo', '01234567-1234-1234-99')] plugin_tag1 = meta_interface._get_device_plugin_tag( 'tap1', namespace=namespace) self.ip_dev.assert_has_calls(expected) - self.assertEquals('fake1', plugin_tag1) + self.assertEqual('fake1', plugin_tag1) class TestIVSInterfaceDriver(TestBase): diff --git a/neutron/tests/unit/test_wsgi.py b/neutron/tests/unit/test_wsgi.py index b05999cb0..a8be55628 100644 --- a/neutron/tests/unit/test_wsgi.py +++ b/neutron/tests/unit/test_wsgi.py @@ -107,7 +107,7 @@ class TestWSGIServer(base.BaseTestCase): server.start(hello_world, 0, host="127.0.0.1") response = urllib2.urlopen('http://127.0.0.1:%d/' % server.port) - self.assertEquals(greetings, response.read()) + self.assertEqual(greetings, response.read()) server.stop() @@ -1088,7 +1088,7 @@ class TestWSGIServerWithSSL(base.BaseTestCase): server.start(hello_world, 0, host="127.0.0.1") response = urllib2.urlopen('https://127.0.0.1:%d/' % server.port) - self.assertEquals(greetings, response.read()) + self.assertEqual(greetings, response.read()) server.stop() @@ -1109,6 +1109,6 @@ class TestWSGIServerWithSSL(base.BaseTestCase): server.start(hello_world, 0, host="::1") response = urllib2.urlopen('https://[::1]:%d/' % server.port) - self.assertEquals(greetings, response.read()) + self.assertEqual(greetings, response.read()) server.stop()