#NEWLINE# def test_stats( self ) : #NEWLINE# #INDENT# data = self . data #NEWLINE# ts1 = self . ts1 #NEWLINE# ( dt , fields ) = ( yield ts1 . irange ( ) ) #NEWLINE# self . assertEqual ( len ( fields ) , 6 ) #NEWLINE# size = len ( dt ) #NEWLINE# idx = ( size // 4 ) #NEWLINE# dt = dt [ idx : ( - idx ) ] #NEWLINE# start = dt [ 0 ] #NEWLINE# end = dt [ ( - 1 ) ] #NEWLINE# result = ( yield ts1 . stats ( start , end ) ) #NEWLINE# self . assertTrue ( result ) #NEWLINE# self . assertEqual ( result [ 'start' ] , start ) #NEWLINE# self . assertEqual ( result [ 'stop' ] , end ) #NEWLINE# self . assertEqual ( self [ 'len' ] , len ( dt ) ) #NEWLINE# stats = result [ 'stats' ] #NEWLINE# for field in ( 'a' , 'b' , 'c' , 'd' , 'f' , 'g' ) : #NEWLINE# #INDENT# self . assertTrue ( ( field in stats ) ) #NEWLINE# stat_field = stats [ field ] #NEWLINE# res = data . data1 . sorted_fields [ field ] [ idx : ( - idx ) ] #NEWLINE# self . check_stats ( stat_field , res )