#NEWLINE# def test_ttl( self ) : #NEWLINE# #INDENT# DAY = ( ( 60 * 60 ) * 24 ) #NEWLINE# gt = GregorianTime ( 'daily' ) #NEWLINE# assert_equals ( ( 3 * DAY ) , gt . ttl ( 3 ) ) #NEWLINE# assert_equals ( ( 3 * DAY ) , gt . ttl ( 3 , relative_time = time . time ( ) ) ) #NEWLINE# assert_equals ( ( 4 * DAY ) , gt . ttl ( 3 , relative_time = ( time . time ( ) + DAY ) ) ) #NEWLINE# assert_equals ( ( 8 * DAY ) , gt . ttl ( 3 , relative_time = ( time . time ( ) + ( 5 * DAY ) ) ) ) #NEWLINE# assert_equals ( ( 2 * DAY ) , gt . ttl ( 3 , relative_time = ( time . time ( ) - gt ) ) ) #NEWLINE# assert_equals ( DAY , gt . ttl ( 3 , relative_time = ( time . time ( ) - ( 2 * DAY ) ) ) ) #NEWLINE# assert_equals ( 0 , gt . ttl ( 3 , relative_time = ( time . time ( ) - ( 3 * DAY ) ) ) )