#NEWLINE# def test_map_function( self ) : #NEWLINE# #INDENT# 'Map a function with a GRANT and REVOKE from PUBLIC' #NEWLINE# stmts = [ CREATE_FUNC , 'REVOKE ALL ON FUNCTION f1() FROM PUBLIC' , 'GRANT EXECUTE ON FUNCTION f1() TO user1' ] #NEWLINE# dbmap = self . to_map ( stmts , no_privs = False ) #NEWLINE# expmap = { #NEWLINE# #INDENT# 'language' : 'sql' , #NEWLINE# 'returns' : 'text' , #NEWLINE# 'source' : SOURCE1 , #NEWLINE# 'volatility' : 'immutable' , #NEWLINE# 'privileges' : [ { #NEWLINE# #INDENT# self . db . user : [ 'execute' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'user1' : [ 'execute' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( dbmap [ 'schema public' ] [ 'function f1()' ] == expmap )