#NEWLINE# def testPeriodsDays( self ) : #NEWLINE# #INDENT# ' Test iteration over periods (days) ' #NEWLINE# assertEqual = expected . assertEqual #NEWLINE# ef = S3TimeSeriesEventFrame ( tp_datetime ( 2011 , 1 , 5 ) , tp_datetime ( 2011 , 1 , 8 ) , slots = 'days' ) #NEWLINE# expected = [ ( tp_datetime ( 2011 , 1 , 5 ) , tp_datetime ( 2011 , 1 , 6 ) ) , ( tp_datetime ( 2011 , 1 , 6 ) , tp_datetime ( 2011 , 1 , 7 ) ) , ( tp_datetime ( 2011 , 1 , 7 ) , tp_datetime ( 2011 , 1 , 8 ) ) ] #NEWLINE# for ( i , period ) in enumerate ( ef ) : #NEWLINE# #INDENT# assertEqual ( period . start , expected [ i ] [ 0 ] ) #NEWLINE# assertEqual ( period . end , expected [ i ] [ 1 ] ) #NEWLINE# #UNINDENT# ef = S3TimeSeriesEventFrame ( tp_datetime ( 2011 , 1 , 5 ) , tp_datetime ( 2011 , 1 , 16 ) , slots = '4 days' ) #NEWLINE# expected = [ ( tp_datetime ( 2011 , 1 , 5 ) , tp_datetime ( 2011 , 1 , 9 ) ) , ( tp_datetime ( 2011 , 1 , 9 ) , tp_datetime ( 2011 , 1 , 13 ) ) , ( tp_datetime ( 2011 , 1 , 13 ) , tp_datetime ( 2011 , 1 , 16 ) ) ] #NEWLINE# for ( i , period ) in enumerate ( ef ) : #NEWLINE# #INDENT# assertEqual ( period . start , expected [ i ] [ 0 ] ) #NEWLINE# assertEqual ( period . end , expected [ i ] [ 1 ] )