#NEWLINE# def test_bagpipe_callback_to_rpc_update_port_router_itf_added( self ) : #NEWLINE# #INDENT# with self . port ( ) as port , self . router ( tenant_id = self . _tenant_id ) as router , mock . patch . object ( self . bagpipe_driver , '_get_port_host' , return_value = TESTHOST ) , self . bgpvpn ( ) as bgpvpn , mock . patch . object ( self . bagpipe_driver , 'get_bgpvpn' , return_value = bgpvpn [ 'bgpvpn' ] ) , mock . patch . object ( bagpipe , 'get_router_bgpvpn_assocs' , return_value = [ { #NEWLINE# #INDENT# 'bgpvpn_id' : bgpvpn [ 'bgpvpn' ] [ 'id' ] , #NEWLINE# #UNINDENT# } ] ) . start ( ) : #NEWLINE# #INDENT# original_port = copy . deepcopy ( self [ 'port' ] ) #NEWLINE# port [ 'port' ] [ 'device_owner' ] = DEVICE_OWNER_ROUTER_INTF #NEWLINE# port [ 'port' ] [ 'device_id' ] = router [ 'router' ] [ 'id' ] #NEWLINE# self . bagpipe_driver . registry_port_updated ( None , None , None , context = self . ctxt , port = port [ 'port' ] , original_port = original_port ) #NEWLINE# self . mock_update_bgpvpn_rpc . assert_called_once_with ( mock . ANY , self . bagpipe_driver . _format_bgpvpn ( bgpvpn [ 'bgpvpn' ] , port [ 'port' ] [ 'network_id' ] ) )