#NEWLINE# def test_bind_port( self ) : #NEWLINE# #INDENT# self . vif_type = 'MY_VIF_TYPE' #NEWLINE# self . vif_details = 'MY_VIF_DETAILS' #NEWLINE# network = mock . MagicMock ( spec = api . NetworkContext ) #NEWLINE# port_context = mock . MagicMock ( spec = ctx . PortContext , current = { #NEWLINE# #INDENT# 'id' : 'CURRENT_CONTEXT_ID' , #NEWLINE# #UNINDENT# } , segments_to_bind = [ self . valid_segment , self . invalid_segment ] , network = network ) #NEWLINE# self . bind_port ( port_context ) #NEWLINE# port_context . set_binding . assert_called_once_with ( self . valid_segment [ api . ID ] , self . vif_type , self . vif_details , status = n_const . PORT_STATUS_ACTIVE )