#NEWLINE# def _common_policy_check( self , func , * arg , **kwarg ) : #NEWLINE# #INDENT# rule_name = 'os_compute_api:os-security-group-default-rules' #NEWLINE# rule = { #NEWLINE# #INDENT# rule_name : 'project:non_fake' , #NEWLINE# #UNINDENT# } #NEWLINE# self . policy . set_rules ( rule ) #NEWLINE# exc = self . assertRaises ( exception . PolicyNotAuthorized , func , * arg , ** kwarg ) #NEWLINE# self . assertEqual ( ( "Policy doesn't allow %s to be performed." % rule_name ) , exc . format_message ( ) )