#NEWLINE# def test_index_policy_failed( self ) : #NEWLINE# #INDENT# rule_name = 'os_compute_api:os-flavor-access' #NEWLINE# self . policy . set_rules ( { #NEWLINE# #INDENT# exc : 'project:non_fake' , #NEWLINE# #UNINDENT# } ) #NEWLINE# exc = self . assertRaises ( exception . PolicyNotAuthorized , self . access_controller . index , self . req , fakes . FAKE_UUID ) #NEWLINE# self . assertEqual ( ( "Policy doesn't allow %s to be performed." % rule_name ) , exc . format_message ( ) )