#NEWLINE# def test_bagpipe_associate_net( self ) : #NEWLINE# #INDENT# mocked_update = self . mocked_bagpipeAPI . update_bgpvpn #NEWLINE# with self . port ( ) as port1 : #NEWLINE# #INDENT# net_id = port1 [ 'port' ] [ 'network_id' ] #NEWLINE# with self . bgpvpn ( ) as bgpvpn : #NEWLINE# #INDENT# id = bgpvpn [ 'bgpvpn' ] [ 'id' ] #NEWLINE# rt = bgpvpn [ 'bgpvpn' ] [ 'route_targets' ] #NEWLINE# mocked_update . reset_mock ( ) #NEWLINE# with self . assoc_net ( id , net_id ) : #NEWLINE# #INDENT# formatted_bgpvpn = { #NEWLINE# #INDENT# 'id' : id , #NEWLINE# 'network_id' : net_id , #NEWLINE# 'l3vpn' : { #NEWLINE# #INDENT# 'import_rt' : rt , #NEWLINE# 'export_rt' : rt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# mocked_update . assert_called_once_with ( mock . ANY , formatted_bgpvpn )