#NEWLINE# def _test_delete( self , req_tenant_id , real_tenant_id , expected_code , expect_errors = False ) : #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# instance = self . plugin . return_value #NEWLINE# instance . get_network . return_value = { #NEWLINE# #INDENT# 'tenant_id' : real_tenant_id , #NEWLINE# 'shared' : False , #NEWLINE# #UNINDENT# } #NEWLINE# instance . delete_network . return_value = None #NEWLINE# res = self . api . delete ( _get_path ( 'networks' , id = uuidutils . generate_uuid ( ) , fmt = self . fmt ) , extra_environ = env , expect_errors = expect_errors ) #NEWLINE# self . assertEqual ( expected_code , res . status_int )