#NEWLINE# def test_fd_wrapper_new_grant( self ) : #NEWLINE# #INDENT# 'Grant privileges on an existing foreign data wrapper' #NEWLINE# inmap = self . std_map ( ) #NEWLINE# inmap . update ( { #NEWLINE# #INDENT# 'foreign data wrapper fdw1' : { #NEWLINE# #INDENT# 'owner' : self . db . user , #NEWLINE# 'privileges' : [ { #NEWLINE# #INDENT# self . db . user : [ 'all' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'PUBLIC' : [ 'usage' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# sql = sorted ( self . to_sql ( inmap , [ CREATE_FDW ] , superuser = True ) ) #NEWLINE# assert ( len ( sql ) == 2 ) #NEWLINE# assert ( sql [ 0 ] == 'GRANT USAGE ON FOREIGN DATA WRAPPER fdw1 TO PUBLIC' ) #NEWLINE# assert ( sql [ 1 ] == ( 'GRANT USAGE ON FOREIGN DATA WRAPPER fdw1 TO %s' % self . db . user ) )