#NEWLINE# def test_main( self ) : #NEWLINE# #INDENT# cfg . CONF . set_override ( 'quitting_rpc_timeout' , 1 , 'AGENT' ) #NEWLINE# cfg . CONF . set_override ( 'polling_interval' , 2 , 'AGENT' ) #NEWLINE# mock_manager_return = mock . Mock ( spec = amb . CommonAgentManagerBase ) #NEWLINE# mock_launch_return = mock . Mock ( ) #NEWLINE# with mock . patch . object ( common_config , 'init' ) , mock . patch . object ( common_config , 'setup_logging' ) , mock . patch . object ( service , 'launch' , return_value = mock_launch_return ) as mock_launch , mock . patch . object ( macvtap_neutron_agent , 'parse_interface_mappings' , return_value = INTERFACE_MAPPINGS ) as mock_pim , mock . patch . object ( macvtap_neutron_agent , 'validate_firewall_driver' ) as mock_vfd , mock . patch ( 'neutron.plugins.ml2.drivers.agent._common_agent.CommonAgentLoop' ) as mock_loop , mock . patch ( 'neutron.plugins.ml2.drivers.macvtap.agent.macvtap_neutron_agent.MacvtapManager' , return_value = mock_manager_return ) as mock_manager : #NEWLINE# #INDENT# macvtap_neutron_agent . main ( ) #NEWLINE# self . assertTrue ( mock_vfd . called ) #NEWLINE# self . assertTrue ( mock_pim . called ) #NEWLINE# mock_manager . assert_called_with ( INTERFACE_MAPPINGS ) #NEWLINE# mock_loop . assert_called_with ( mock_manager_return , 2 , 1 , 'Macvtap agent' , 'neutron-macvtap-agent' ) #NEWLINE# self . assertTrue ( mock_launch . called ) #NEWLINE# self . assertTrue ( mock_launch_return . wait . called )