#NEWLINE# def testAppendInvalidDatetime( self ) : #NEWLINE# #INDENT# ds = bards . BarDataSeries ( ) #NEWLINE# for i in range ( 10 ) : #NEWLINE# #INDENT# now = ( datetime . datetime . now ( ) + datetime . timedelta ( seconds = i ) ) #NEWLINE# ds . append ( bar . BasicBar ( now , 0 , 0 , 0 , 0 , 0 , 0 , bar . Frequency . SECOND ) ) #NEWLINE# with self . assertRaises ( Exception ) : #NEWLINE# #INDENT# ds . append ( bar . BasicBar ( now , 0 , 0 , 0 , 0 , 0 , 0 , bar . Frequency . SECOND ) ) #NEWLINE# #UNINDENT# with self . assertRaises ( Exception ) : #NEWLINE# #INDENT# ds . append ( bar . BasicBar ( ( now - datetime . timedelta ( seconds = i ) ) , 0 , 0 , 0 , 0 , 0 , 0 , bar . Frequency . SECOND ) )