#NEWLINE# def test_router_update_with_invalid_ip_address( self ) : #NEWLINE# #INDENT# 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 . _router_interface_action ( 'add' , r [ 'router' ] [ 'id' ] , None , p [ 'port' ] [ 'id' ] ) #NEWLINE# routes = [ { #NEWLINE# #INDENT# 'destination' : '512.207.0.0/16' , #NEWLINE# 'nexthop' : '10.0.1.3' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . _update ( 'routers' , r [ 'router' ] [ 'id' ] , { #NEWLINE# #INDENT# 'router' : { #NEWLINE# #INDENT# 'routes' : routes , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , expected_code = exc . HTTPBadRequest . code ) #NEWLINE# routes = [ { #NEWLINE# #INDENT# 'destination' : '127.207.0.0/48' , #NEWLINE# 'nexthop' : '10.0.1.3' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . _update ( 'routers' , r [ 'router' ] [ 'id' ] , { #NEWLINE# #INDENT# 'router' : { #NEWLINE# #INDENT# 'routes' : routes , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , expected_code = exc . HTTPBadRequest . code ) #NEWLINE# routes = [ { #NEWLINE# #INDENT# 'destination' : 'invalid_ip_address' , #NEWLINE# 'nexthop' : '10.0.1.3' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . _update ( 'routers' , r [ 'router' ] [ 'id' ] , { #NEWLINE# #INDENT# 'router' : { #NEWLINE# #INDENT# 'routes' : routes , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , expected_code = exc . HTTPBadRequest . code ) #NEWLINE# self . _router_interface_action ( 'remove' , r [ 'router' ] [ 'id' ] , None , p [ 'port' ] [ 'id' ] )