#NEWLINE# def test_representation( self ) : #NEWLINE# #INDENT# idx1 = TimedeltaIndex ( [ ] , freq = 'D' ) #NEWLINE# idx2 = TimedeltaIndex ( [ '1 days' ] , freq = 'D' ) #NEWLINE# idx3 = TimedeltaIndex ( [ '1 days' , '2 days' ] , freq = 'D' ) #NEWLINE# idx4 = TimedeltaIndex ( [ '1 days' , '2 days' , '3 days' ] , freq = 'D' ) #NEWLINE# idx5 = TimedeltaIndex ( [ '1 days 00:00:01' , '2 days' , '3 days' ] ) #NEWLINE# exp1 = "TimedeltaIndex([], dtype='timedelta64[ns]', freq='D')" #NEWLINE# exp2 = "TimedeltaIndex(['1 days'], dtype='timedelta64[ns]', freq='D')" #NEWLINE# exp3 = "TimedeltaIndex(['1 days', '2 days'], dtype='timedelta64[ns]', freq='D')" #NEWLINE# exp4 = "TimedeltaIndex(['1 days', '2 days', '3 days'], dtype='timedelta64[ns]', freq='D')" #NEWLINE# exp5 = "TimedeltaIndex(['1 days 00:00:01', '2 days 00:00:00', '3 days 00:00:00'], dtype='timedelta64[ns]', freq=None)" #NEWLINE# with pd . option_context ( 'display.width' , 300 ) : #NEWLINE# #INDENT# for ( idx , expected ) in zip ( [ idx1 , idx2 , idx2 , idx4 , idx5 ] , [ exp1 , exp2 , exp3 , exp4 , exp5 ] ) : #NEWLINE# #INDENT# for func in [ '__repr__' , '__unicode__' , '__str__' ] : #NEWLINE# #INDENT# result = getattr ( idx , func ) ( ) #NEWLINE# self . assertEqual ( result , expected )