#NEWLINE# def test_map_server( self ) : #NEWLINE# #INDENT# 'Map a foreign server with a GRANT' #NEWLINE# stmts = [ CREATE_FDW , CREATE_FS , 'GRANT USAGE ON FOREIGN SERVER fs1 TO user1' ] #NEWLINE# dbmap = self . to_map ( stmts , no_privs = False , superuser = True ) #NEWLINE# expmap = { #NEWLINE# #INDENT# 'privileges' : [ { #NEWLINE# #INDENT# stmts . db . user : [ 'usage' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'user1' : [ 'usage' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( dbmap [ 'foreign data wrapper fdw1' ] [ 'server fs1' ] == expmap )