#NEWLINE# def test_pivot( self ) : #NEWLINE# #INDENT# table = Table ( self . rows , table . column_names , self . column_types ) #NEWLINE# pivot_table = table . pivot ( 'race' , 'gender' ) #NEWLINE# pivot_rows = ( ( 'white' , 1 , 2 ) , ( 'black' , 1 , 0 ) , ( 'latino' , 1 , 0 ) , ( 'asian' , 0 , 1 ) ) #NEWLINE# self . assertColumnNames ( pivot_table , [ 'race' , 'male' , 'female' ] ) #NEWLINE# self . assertRowNames ( pivot_table , [ 'white' , 'black' , 'latino' , 'asian' ] ) #NEWLINE# self . assertColumnTypes ( pivot_table , [ Text , Number , Number ] ) #NEWLINE# self . assertRows ( pivot_table , pivot_rows )