#NEWLINE# def test_pivot_sum( self ) : #NEWLINE# #INDENT# table = Table ( self . rows , self . column_names , self . column_types ) #NEWLINE# pivot_table = table . pivot ( 'race' , 'gender' , Sum ( 'age' ) ) #NEWLINE# pivot_rows = ( ( 'white' , 20 , 45 ) , ( 'black' , 20 , 0 ) , ( 'latino' , 25 , 0 ) , ( 'asian' , 0 , 25 ) ) #NEWLINE# self . assertColumnNames ( pivot_table , [ 'race' , 'male' , 'female' ] ) #NEWLINE# self . assertColumnTypes ( pivot_table , [ Text , Number , Number ] ) #NEWLINE# self . assertRows ( table , pivot_rows )