Merge "Use assertIsNone(observed) instead of assertEqual(None, observed)"

This commit is contained in:
Jenkins 2015-10-06 11:33:44 +00:00 committed by Gerrit Code Review
commit 396a5b4e50
8 changed files with 11 additions and 12 deletions

View File

@ -591,7 +591,7 @@ class NetworksIpV6TestJSON(NetworksTestJSON):
# Verifies Subnet GW is set in IPv6 # Verifies Subnet GW is set in IPv6
self.assertEqual(subnet1['gateway_ip'], ipv6_gateway) self.assertEqual(subnet1['gateway_ip'], ipv6_gateway)
# Verifies Subnet GW is None in IPv4 # Verifies Subnet GW is None in IPv4
self.assertEqual(subnet2['gateway_ip'], None) self.assertIsNone(subnet2['gateway_ip'])
# Verifies all 2 subnets in the same network # Verifies all 2 subnets in the same network
body = self.client.list_subnets() body = self.client.list_subnets()
subnets = [sub['id'] for sub in body['subnets'] subnets = [sub['id'] for sub in body['subnets']

View File

@ -324,7 +324,7 @@ class OVS_Lib_Test(base.BaseTestCase):
run_ofctl = mock.patch.object(self.br, 'run_ofctl').start() run_ofctl = mock.patch.object(self.br, 'run_ofctl').start()
run_ofctl.side_effect = [''] run_ofctl.side_effect = ['']
retflows = self.br.dump_flows_for_table(table) retflows = self.br.dump_flows_for_table(table)
self.assertEqual(None, retflows) self.assertIsNone(retflows)
def test_mod_flow_with_priority_set(self): def test_mod_flow_with_priority_set(self):
params = {'in_port': '1', params = {'in_port': '1',

View File

@ -210,7 +210,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
report_state.assert_called_once_with(agent.context, report_state.assert_called_once_with(agent.context,
agent.agent_state, agent.agent_state,
use_call_arg) use_call_arg)
self.assertTrue(agent.agent_state.get('start_flag') is None) self.assertIsNone(agent.agent_state.get('start_flag'))
def test_periodic_sync_routers_task_call_clean_stale_namespaces(self): def test_periodic_sync_routers_task_call_clean_stale_namespaces(self):
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf) agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)

View File

@ -303,7 +303,7 @@ class TestDvrRouterOperations(base.BaseTestCase):
port = {'fixed_ips': [{'subnet_id': mock.sentinel.subnet_id}]} port = {'fixed_ips': [{'subnet_id': mock.sentinel.subnet_id}]}
router_ports = [port] router_ports = [port]
ri.router.get.return_value = router_ports ri.router.get.return_value = router_ports
self.assertEqual(None, ri._get_internal_port(mock.sentinel.subnet_id2)) self.assertIsNone(ri._get_internal_port(mock.sentinel.subnet_id2))
def test__get_snat_idx_ipv4(self): def test__get_snat_idx_ipv4(self):
ip_cidr = '101.12.13.00/24' ip_cidr = '101.12.13.00/24'

View File

@ -102,4 +102,4 @@ class VlanTransparentExtensionTestCase(test_db_base_plugin_v2.TestNetworksV2):
res = self.deserialize(self.fmt, req.get_response(self.api)) res = self.deserialize(self.fmt, req.get_response(self.api))
self.assertEqual(net['network']['name'], self.assertEqual(net['network']['name'],
res['network']['name']) res['network']['name'])
self.assertEqual(None, res['network'][vlt.VLANTRANSPARENT]) self.assertIsNone(res['network'][vlt.VLANTRANSPARENT])

View File

@ -43,8 +43,8 @@ class TestIpamSubnetRequests(IpamSubnetRequestTestCase):
self.subnet_id) self.subnet_id)
self.assertEqual(self.tenant_id, pool.tenant_id) self.assertEqual(self.tenant_id, pool.tenant_id)
self.assertEqual(self.subnet_id, pool.subnet_id) self.assertEqual(self.subnet_id, pool.subnet_id)
self.assertEqual(None, pool.gateway_ip) self.assertIsNone(pool.gateway_ip)
self.assertEqual(None, pool.allocation_pools) self.assertIsNone(pool.allocation_pools)
def test_subnet_request_gateway(self): def test_subnet_request_gateway(self):
request = ipam_req.SubnetRequest(self.tenant_id, request = ipam_req.SubnetRequest(self.tenant_id,
@ -364,8 +364,8 @@ class TestSubnetRequestFactory(IpamSubnetRequestTestCase):
ipam_req.SpecificSubnetRequest) ipam_req.SpecificSubnetRequest)
self.assertEqual(self.tenant_id, request.tenant_id) self.assertEqual(self.tenant_id, request.tenant_id)
self.assertEqual(self.subnet_id, request.subnet_id) self.assertEqual(self.subnet_id, request.subnet_id)
self.assertEqual(None, request.gateway_ip) self.assertIsNone(request.gateway_ip)
self.assertEqual(None, request.allocation_pools) self.assertIsNone(request.allocation_pools)
class TestGetRequestFactory(base.BaseTestCase): class TestGetRequestFactory(base.BaseTestCase):

View File

@ -178,7 +178,7 @@ class TestNovaNotify(base.BaseTestCase):
event = self.nova_notifier.create_port_changed_event( event = self.nova_notifier.create_port_changed_event(
'delete_floatingip', {}, returned_obj) 'delete_floatingip', {}, returned_obj)
self.assertEqual(event, None) self.assertIsNone(event)
def test_associate_floatingip_notify(self): def test_associate_floatingip_notify(self):
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87' device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'

View File

@ -386,8 +386,7 @@ class TestLinuxBridgeManager(base.BaseTestCase):
self.lbm.get_existing_bridge_name(phy_net)) self.lbm.get_existing_bridge_name(phy_net))
phy_net = '' phy_net = ''
self.assertEqual(None, self.assertIsNone(self.lbm.get_existing_bridge_name(phy_net))
self.lbm.get_existing_bridge_name(phy_net))
def test_get_bridge_name(self): def test_get_bridge_name(self):
nw_id = "123456789101112" nw_id = "123456789101112"