#NEWLINE# def test_route_clear_routes_with_None( self ) : #NEWLINE# #INDENT# routes = [ { #NEWLINE# #INDENT# 'destination' : '135.207.0.0/16' , #NEWLINE# 'nexthop' : '10.0.1.3' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'destination' : '12.0.0.0/8' , #NEWLINE# 'nexthop' : '10.0.1.4' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'destination' : '141.212.0.0/16' , #NEWLINE# 'nexthop' : '10.0.1.5' , #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# self . _routes_update_prepare ( r [ 'router' ] [ 'id' ] , None , p [ 'port' ] [ 'id' ] , routes ) #NEWLINE# body = self . _update ( 'routers' , r [ 'router' ] [ 'id' ] , { #NEWLINE# #INDENT# 'router' : { #NEWLINE# #INDENT# 'routes' : None , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( [ ] , body [ 'router' ] [ 'routes' ] ) #NEWLINE# self . _routes_update_cleanup ( p [ 'port' ] [ 'id' ] , None , r [ 'router' ] [ 'id' ] , [ ] )