#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . neutron : ( 'network_get' , 'is_extension_supported' , 'subnetpool_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_subnet_create_post_invalid_pools_ip_network( self , test_w_snpool = False ) : #NEWLINE# #INDENT# network = self . networks . first ( ) #NEWLINE# subnet = self . subnets . first ( ) #NEWLINE# api . neutron . network_get ( IsA ( http . HttpRequest ) , network . id ) . AndReturn ( network ) #NEWLINE# api . neutron . is_extension_supported ( IsA ( http . HttpRequest ) , 'subnet_allocation' ) . AndReturn ( True ) #NEWLINE# api . neutron . subnetpool_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . subnetpools . list ( ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if test_w_snpool : #NEWLINE# #INDENT# subnetpool = self . subnetpools . first ( ) #NEWLINE# form_data [ 'subnetpool' ] = subnetpool . id #NEWLINE# #UNINDENT# allocation_pools = '10.0.0.2/24,10.0.0.5' #NEWLINE# form_data . update ( form_data_subnet ( subnet , allocation_pools = allocation_pools ) ) #NEWLINE# url = reverse ( 'horizon:project:networks:addsubnet' , args = [ subnet . network_id ] ) #NEWLINE# res = self . client . post ( url , form_data ) #NEWLINE# self . assertContains ( res , ( 'allocation_pools: Invalid IP address (value=%s)' % allocation_pools . split ( ',' ) [ 0 ] ) )