#NEWLINE# def test_router_interface_in_use_by_route( self ) : #NEWLINE# #INDENT# routes = [ { #NEWLINE# #INDENT# 'destination' : '135.207.0.0/16' , #NEWLINE# 'nexthop' : '10.0.1.3' , #NEWLINE# #UNINDENT# } ] #NEWLINE# with self . router ( ) as r : #NEWLINE# #INDENT# with self . subnet ( cidr = '10.0.1.0/24' ) as s : #NEWLINE# #INDENT# with self . port ( subnet = s ) as p : #NEWLINE# #INDENT# body = self . _routes_update_prepare ( r [ 'router' ] [ 'id' ] , None , p [ 'port' ] [ 'id' ] , routes ) #NEWLINE# self . assertEqual ( routes , body [ 'router' ] [ 'routes' ] ) #NEWLINE# self . _router_interface_action ( 'remove' , self [ 'router' ] [ 'id' ] , None , p [ 'port' ] [ 'id' ] , expected_code = exc . HTTPConflict . code ) #NEWLINE# self . _routes_update_cleanup ( p [ 'port' ] [ 'id' ] , None , r [ 'router' ] [ 'id' ] , [ ] )