#NEWLINE# def testAggregateCount( self ) : #NEWLINE# #INDENT# ' Test aggregation: count (single axis)  ' #NEWLINE# period = self . period #NEWLINE# assertEqual = self . assertEqual #NEWLINE# totals = period . aggregate ( S3TimeSeriesFact ( 'count' , 'base' ) ) #NEWLINE# expected_rows = { #NEWLINE# #INDENT# 'A' : [ 4 ] , #NEWLINE# 'B' : [ 4 ] , #NEWLINE# 'C' : [ 4 ] , #NEWLINE# #UNINDENT# } #NEWLINE# rows = period . rows #NEWLINE# assertEqual ( set ( rows . keys ( ) ) , set ( expected_rows . keys ( ) ) ) #NEWLINE# for ( k , v ) in rows . items ( ) : #NEWLINE# #INDENT# assertEqual ( v , expected_rows . get ( k ) , msg = ( 'Row %s: %s != %s' % ( k , v , expected_rows . get ( k ) ) ) ) #NEWLINE# #UNINDENT# assertEqual ( period . cols , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assertEqual ( period . matrix , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# expected_totals = [ 12 ] #NEWLINE# assertEqual ( period . totals , expected_totals ) #NEWLINE# assertEqual ( totals , expected_totals )