#NEWLINE# def test_add_tenant_access_with_no_tenant( self ) : #NEWLINE# #INDENT# req = fakes . HTTPRequest . blank ( ( self . _prefix + '/flavors/2/action' ) , use_admin_context = True ) #NEWLINE# body = { #NEWLINE# #INDENT# 'addTenantAccess' : { #NEWLINE# #INDENT# 'foo' : 'proj2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# add_access = self . _get_add_access ( ) #NEWLINE# self . assertRaises ( self . validation_ex , add_access , req , '2' , body = body ) #NEWLINE# body = { #NEWLINE# #INDENT# 'addTenantAccess' : { #NEWLINE# #INDENT# 'tenant' : '' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertRaises ( self . validation_ex , add_access , req , '2' , body = body )