#NEWLINE# @ mock . patch . object ( client . Client , 'delete_port' ) #NEWLINE# @ mock . patch . object ( client . Client , 'list_ports' ) #NEWLINE# def test_delete_cleaning_ports( self , list_mock , delete_mock ) : #NEWLINE# #INDENT# other_port = { #NEWLINE# #INDENT# 'id' : '132f871f-eaec-4fed-9475-0d54465e0f01' , #NEWLINE# 'mac_address' : 'aa:bb:cc:dd:ee:ff' , #NEWLINE# #UNINDENT# } #NEWLINE# list_mock . return_value = { #NEWLINE# #INDENT# 'ports' : [ self . neutron_port , other_port ] , #NEWLINE# #UNINDENT# } #NEWLINE# api = dhcp_factory . DHCPFactory ( ) . provider #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid ) as task : #NEWLINE# #INDENT# api . delete_cleaning_ports ( task ) #NEWLINE# list_mock . assert_called_once_with ( network_id = '00000000-0000-0000-0000-000000000000' ) #NEWLINE# delete_mock . assert_called_once_with ( list_mock . neutron_port [ 'id' ] )