#NEWLINE# def _test_list( self , req_tenant_id , real_tenant_id ) : #NEWLINE# #INDENT# env = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if req_tenant_id : #NEWLINE# #INDENT# env = { #NEWLINE# #INDENT# 'neutron.context' : context . Context ( '' , req_tenant_id ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# input_dict = { #NEWLINE# #INDENT# 'id' : uuidutils . generate_uuid ( ) , #NEWLINE# 'name' : 'net1' , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'tenant_id' : real_tenant_id , #NEWLINE# 'shared' : False , #NEWLINE# 'subnets' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# return_value = [ input_dict ] #NEWLINE# instance = self . plugin . return_value #NEWLINE# instance . get_networks . return_value = return_value #NEWLINE# res = self . api . get ( _get_path ( 'networks' , fmt = self . fmt ) , extra_environ = env ) #NEWLINE# res = self . deserialize ( res ) #NEWLINE# self . assertIn ( 'networks' , res ) #NEWLINE# if ( ( not req_tenant_id ) or ( req_tenant_id == real_tenant_id ) ) : #NEWLINE# #INDENT# self . assertEqual ( 1 , len ( res [ 'networks' ] ) ) #NEWLINE# output_dict = res [ 'networks' ] [ 0 ] #NEWLINE# input_dict [ 'shared' ] = False #NEWLINE# self . assertEqual ( len ( input_dict ) , len ( output_dict ) ) #NEWLINE# for ( k , v ) in six . iteritems ( input_dict ) : #NEWLINE# #INDENT# self . assertEqual ( v , output_dict [ k ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( 0 , len ( res [ 'networks' ] ) )