#NEWLINE# @ mock . patch ( 'eventlet.GreenPool.spawn_n' ) #NEWLINE# def test_process_services_with_updated_routers( self , mock_spawn ) : #NEWLINE# #INDENT# ( router1 , port ) = prepare_router_data ( ) #NEWLINE# def routers_data( context , router_ids = None , hd_ids = None ) : #NEWLINE# #INDENT# if router_ids : #NEWLINE# #INDENT# return [ router1 ] #NEWLINE# #UNINDENT# #UNINDENT# self . plugin_api . get_routers . side_effect = routers_data #NEWLINE# self . routing_helper . fullsync = False #NEWLINE# self . routing_helper . updated_routers . add ( router1 [ 'id' ] ) #NEWLINE# self . routing_helper . process_service ( ) #NEWLINE# self . assertEqual ( 1 , self . plugin_api . get_routers . call_count ) #NEWLINE# self . plugin_api . get_routers . assert_called_with ( self . routing_helper . context , router_ids = [ routers_data [ 'id' ] ] ) #NEWLINE# self . assertEqual ( 1 , mock_spawn . call_count ) #NEWLINE# mock_spawn . assert_called_with ( self . routing_helper . _process_routers , [ router1 ] , [ ] , router1 [ 'hosting_device' ] [ 'id' ] , all_routers = False )