#NEWLINE# def test_disassociate_host_only_policy_failed( self ) : #NEWLINE# #INDENT# rule_name = 'os_compute_api:os-networks-associate' #NEWLINE# self . policy . set_rules ( { #NEWLINE# #INDENT# rule_name : 'project:non_fake' , #NEWLINE# #UNINDENT# } ) #NEWLINE# exc = self . assertRaises ( exception . PolicyNotAuthorized , self . controller . _associate_host , self . req , fakes . FAKE_UUID , body = { #NEWLINE# #INDENT# 'associate_host' : 'fake_host' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( ( "Policy doesn't allow %s to be performed." % rule_name ) , exc . format_message ( ) )