#NEWLINE# def test_sequence_new_grant( self ) : #NEWLINE# #INDENT# 'Grant privileges on an existing sequence' #NEWLINE# inmap = self . std_map ( ) #NEWLINE# inmap [ 'schema public' ] . update ( { #NEWLINE# #INDENT# 'sequence seq1' : { #NEWLINE# #INDENT# 'start_value' : 1 , #NEWLINE# 'increment_by' : 1 , #NEWLINE# 'max_value' : None , #NEWLINE# 'min_value' : None , #NEWLINE# 'cache_value' : 1 , #NEWLINE# 'owner' : self . db . user , #NEWLINE# 'privileges' : [ { #NEWLINE# #INDENT# self . db . user : [ 'all' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'PUBLIC' : [ 'select' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# sql = sorted ( self . to_sql ( inmap , [ 'CREATE SEQUENCE seq1' ] ) ) #NEWLINE# assert ( len ( sql ) == 2 ) #NEWLINE# assert ( sql [ 0 ] == ( 'GRANT ALL ON SEQUENCE seq1 TO %s' % self . db . user ) ) #NEWLINE# assert ( sql [ 1 ] == 'GRANT SELECT ON SEQUENCE seq1 TO PUBLIC' )