#NEWLINE# def test_table_revoke_all( self ) : #NEWLINE# #INDENT# 'Revoke all privileges on an existing table' #NEWLINE# inmap = self . std_map ( ) #NEWLINE# inmap [ 'schema public' ] . update ( { #NEWLINE# #INDENT# 'table t1' : { #NEWLINE# #INDENT# 'columns' : [ { #NEWLINE# #INDENT# 'c1' : { #NEWLINE# #INDENT# 'type' : 'integer' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'c2' : { #NEWLINE# #INDENT# 'type' : 'text' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'owner' : inmap . db . user , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# stmts = [ CREATE_TABLE , ( GRANT_SELECT % 'PUBLIC' ) , ( GRANT_INSUPD % 'user1' ) ] #NEWLINE# sql = sorted ( self . to_sql ( inmap , stmts ) ) #NEWLINE# assert ( len ( sql ) == 3 ) #NEWLINE# assert ( sql [ 0 ] == ( 'REVOKE ALL ON TABLE t1 FROM %s' % self . db . user ) ) #NEWLINE# assert ( sql [ 1 ] == 'REVOKE INSERT, UPDATE ON TABLE t1 FROM user1' ) #NEWLINE# assert ( sql [ 2 ] == 'REVOKE SELECT ON TABLE t1 FROM PUBLIC' )