#NEWLINE# def to_sql( self , inmap , stmts = None , config = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , superuser = False , schemas = [ ] , revert = False , quote_reserved = False ) : #NEWLINE# #INDENT# 'Execute statements and compare database to input map.\n\n        :param inmap: dictionary defining target database\n        :param stmts: list of SQL database setup statements\n        :param config: dictionary of configuration information\n        :param superuser: indicates test requires superuser privilege\n        :param schemas: list of schemas to diff\n        :param revert: generate statements to back out changes\n        :param quote_reserved: fetch reserved words\n        :return: list of SQL statements\n        ' #NEWLINE# if ( ( self . superuser or superuser ) and ( not self . db . is_superuser ( ) ) ) : #NEWLINE# #INDENT# self . skipTest ( 'Must be a superuser to run this test' ) #NEWLINE# #UNINDENT# if stmts : #NEWLINE# #INDENT# for stmt in stmts : #NEWLINE# #INDENT# self . db . execute ( stmt ) #NEWLINE# #UNINDENT# self . db . conn . commit ( ) #NEWLINE# #UNINDENT# if ( 'datacopy' in config ) : #NEWLINE# #INDENT# self . cfg . merge ( { #NEWLINE# #INDENT# 'files' : { #NEWLINE# #INDENT# 'data_path' : os . path . join ( TEST_DIR , self . cfg [ 'repository' ] [ 'data' ] ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . config_options ( schemas = schemas , revert = revert , quote_reserved = quote_reserved ) #NEWLINE# self . cfg . merge ( config ) #NEWLINE# return self . database ( ) . diff_map ( superuser )