Merge "Cleanups after python 3 support"

changes/85/344085/3
Jenkins 7 years ago committed by Gerrit Code Review
commit 64d5f91724

@ -33,12 +33,12 @@ class TestTunnelCalls(base.BaseTestCase):
self.context = mock.MagicMock()
def test_trigger_tunnel_sync(self):
with mock.patch.object(rpc, 'RpcCallbacks'):
with mock.patch.object(type_tunnel.TunnelRpcCallbackMixin,
'tunnel_sync') as mock_tunnel_sync:
self.tunnel_call.trigger_tunnel_sync(self.context, 'fake_ip')
mock_tunnel_sync.assert_called_with(
self.context, tunnel_ip='fake_ip', tunnel_type='vxlan')
with mock.patch.object(rpc, 'RpcCallbacks'), \
mock.patch.object(type_tunnel.TunnelRpcCallbackMixin,
'tunnel_sync') as mock_tunnel_sync:
self.tunnel_call.trigger_tunnel_sync(self.context, 'fake_ip')
mock_tunnel_sync.assert_called_with(
self.context, tunnel_ip='fake_ip', tunnel_type='vxlan')
def test_trigger_l2pop_sync(self):
fake_fdb_entry = "fake_fdb_entry"

@ -144,22 +144,22 @@ class TestAgentScheduler(base.BaseTestCase):
'1001', srv_const.AGENT_TYPE_L2GATEWAY, config))
with mock.patch.object(self.agentsch,
'_select_agent_type') as select_agent:
with mock.patch.object(
'_select_agent_type') as select_agent, \
mock.patch.object(
self.plugin, 'get_agents',
return_value=fake_all_agent_list) as get_agent_list:
with mock.patch.object(self.agentsch, 'is_agent_down',
return_value=False) as is_agt:
self.agentsch.monitor_agent_state()
self.assertTrue(get_agent_list.called)
self.assertTrue(select_agent.called)
self.assertTrue(is_agt.called)
return_value=fake_all_agent_list) as get_agent_list, \
mock.patch.object(self.agentsch, 'is_agent_down',
return_value=False) as is_agt:
self.agentsch.monitor_agent_state()
self.assertTrue(get_agent_list.called)
self.assertTrue(select_agent.called)
self.assertTrue(is_agt.called)
def test_monitor_agent_state_exception_get_agents(self):
with mock.patch.object(
self.plugin, 'get_agents',
side_effect=Exception) as get_agent_list:
with mock.patch.object(self.LOG, 'exception') as exception_log:
self.agentsch.monitor_agent_state()
self.assertTrue(get_agent_list.called)
self.assertTrue(exception_log.called)
side_effect=Exception) as get_agent_list, \
mock.patch.object(self.LOG, 'exception') as exception_log:
self.agentsch.monitor_agent_state()
self.assertTrue(get_agent_list.called)
self.assertTrue(exception_log.called)

@ -38,8 +38,8 @@ commands = python setup.py build_sphinx
[flake8]
# H803 skipped on purpose per list discussion.
# H302 import only modules
# E123, E125 skipped as they are invalid PEP-8.
# E123 skipped as they are invalid PEP-8.
# H904 Wrap long lines in parentheses instead of a backslash
show-source = True
ignore = E123,H803,H302,H904
builtins = _

Loading…
Cancel
Save