#NEWLINE# @ mock . patch ( 'nova.objects.Flavor._flavor_get_by_flavor_id_from_db' , side_effect = exception . FlavorNotFound ( flavor_id = 'foo' ) ) #NEWLINE# def test_add_tenant_access_is_public( self , mock_api_get ) : #NEWLINE# #INDENT# body = { #NEWLINE# #INDENT# 'addTenantAccess' : { #NEWLINE# #INDENT# 'tenant' : 'proj2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# req = fakes . HTTPRequest . blank ( ( self . _prefix + '/flavors/2/action' ) , use_admin_context = True ) #NEWLINE# req . api_version_request = api_version . APIVersionRequest ( '2.7' ) #NEWLINE# add_access = self . _get_add_access ( ) #NEWLINE# self . assertRaises ( exc . HTTPConflict , body , req , '1' , body = body )