#NEWLINE# @ mock . patch . object ( vmops . VMOps , '_get_neutron_events' ) #NEWLINE# @ mock . patch . object ( vmops . utils , 'is_neutron' ) #NEWLINE# def test_wait_vif_plug_events( self , mock_is_neutron , mock_get_events ) : #NEWLINE# #INDENT# self . _vmops . _virtapi . wait_for_instance_event . side_effect = etimeout . Timeout #NEWLINE# self . flags ( vif_plugging_timeout = 1 ) #NEWLINE# self . flags ( vif_plugging_is_fatal = True ) #NEWLINE# def _context_user( ) : #NEWLINE# #INDENT# with self . _vmops . wait_vif_plug_events ( mock . sentinel . instance , mock . sentinel . network_info ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertRaises ( exception . VirtualInterfaceCreateException , self ) #NEWLINE# mock_is_neutron . assert_called_once_with ( ) #NEWLINE# mock_get_events . assert_called_once_with ( mock . sentinel . network_info ) #NEWLINE# self . _vmops . _virtapi . wait_for_instance_event . assert_called_once_with ( mock . sentinel . instance , mock_get_events . return_value , deadline = CONF . vif_plugging_timeout , error_callback = self . _vmops . _neutron_failed_callback )