#NEWLINE# def testOrderBySortTable( self ) : #NEWLINE# #INDENT# column_names = [ ] #NEWLINE# order_list = [ 'hello' ] #NEWLINE# clause = query_lib . _OrderByClause ( order_list ) #NEWLINE# self . assertRaises ( bigquery_client . BigqueryInvalidQueryError , clause . SortTable , column_names , None ) #NEWLINE# column_names = [ { #NEWLINE# #INDENT# 'name' : 'a' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'b' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'c' , #NEWLINE# #UNINDENT# } ] #NEWLINE# order_list = [ 'c asc' , 'b desc' , 'a' ] #NEWLINE# table_values = [ [ 1 , 2 , 'hey' ] , [ 1 , 3 , 'hey' ] , [ 2 , 3 , 'hello' ] ] #NEWLINE# real_table = [ [ 2 , 3 , 'hello' ] , [ 1 , 3 , 'hey' ] , [ 1 , 2 , 'hey' ] ] #NEWLINE# clause = query_lib . _OrderByClause ( order_list ) #NEWLINE# table = clause . SortTable ( column_names , table_values ) #NEWLINE# self . assertEqual ( table , real_table )