#NEWLINE# def test_absent_table( self ) : #NEWLINE# #INDENT# '\n        Test absent\n        ' #NEWLINE# with patch . dict ( postgres_privileges . __salt__ , { #NEWLINE# #INDENT# 'postgres.has_privileges' : self . mock_false , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( postgres_privileges . __opts__ , { #NEWLINE# #INDENT# 'test' : True , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# comt = 'The requested privilege(s) are not set so cannot be revoked' #NEWLINE# self . ret . update ( { #NEWLINE# #INDENT# 'comment' : comt , #NEWLINE# 'result' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( postgres_privileges . absent ( self . name , self . table_name , 'table' ) , self . ret ) #NEWLINE# #UNINDENT# #UNINDENT# with patch . dict ( postgres_privileges . __salt__ , { #NEWLINE# #INDENT# 'postgres.has_privileges' : self . mock_true , #NEWLINE# 'postgres.privileges_revoke' : self . mock_true , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( postgres_privileges . __opts__ , { #NEWLINE# #INDENT# 'test' : True , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# comt = 'The privilege(s): {0} are set to be revoked from {1}' . format ( 'ALL' , self . name ) #NEWLINE# self . ret . update ( { #NEWLINE# #INDENT# 'comment' : comt , #NEWLINE# 'result' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( postgres_privileges . absent ( self . name , self . table_name , 'table' , privileges = [ 'ALL' ] ) , self . ret ) #NEWLINE# #UNINDENT# with patch . dict ( postgres_privileges . __opts__ , { #NEWLINE# #INDENT# 'test' : False , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# comt = 'The privilege(s): {0} have been revoked from {1}' . format ( 'ALL' , comt . name ) #NEWLINE# self . ret . update ( { #NEWLINE# #INDENT# 'comment' : comt , #NEWLINE# 'result' : True , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# 'baruwa' : 'Absent' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( postgres_privileges . absent ( self . name , self . table_name , 'table' , privileges = [ 'ALL' ] ) , self . ret )