#NEWLINE# @ mock . patch . object ( ip_lib , 'IPWrapper' ) #NEWLINE# @ mock . patch ( 'eventlet.spawn_n' ) #NEWLINE# def test_send_ipv4_addr_adv_notif( self , spawn_n , mIPWrapper ) : #NEWLINE# #INDENT# spawn_n . side_effect = ( lambda f : f ( ) ) #NEWLINE# ARPING_COUNT = 3 #NEWLINE# address = '20.0.0.1' #NEWLINE# config = mock . Mock ( ) #NEWLINE# config . send_arp_for_ha = mIPWrapper #NEWLINE# ip_lib . send_ip_addr_adv_notif ( mock . sentinel . ns_name , mock . sentinel . iface_name , address , config ) #NEWLINE# self . assertTrue ( spawn_n . called ) #NEWLINE# mIPWrapper . assert_called_once_with ( namespace = mock . sentinel . ns_name ) #NEWLINE# ip_wrapper = mIPWrapper ( namespace = mock . sentinel . ns_name ) #NEWLINE# arping_cmd = [ 'arping' , '-A' , '-I' , mock . sentinel . iface_name , '-c' , ARPING_COUNT , '-w' , mock . ANY , address ] #NEWLINE# ip_wrapper . netns . execute . assert_any_call ( arping_cmd , check_exit_code = True )