#NEWLINE# def test_step_size( self ) : #NEWLINE# #INDENT# DAY = ( ( 60 * 60 ) * 24 ) #NEWLINE# gtd = GregorianTime ( 'daily' ) #NEWLINE# gtm = GregorianTime ( 'monthly' ) #NEWLINE# gty = GregorianTime ( 'yearly' ) #NEWLINE# t0 = time . mktime ( datetime ( year = 2012 , month = 1 , day = 1 ) . timetuple ( ) ) #NEWLINE# t1 = time . mktime ( datetime ( year = 2012 , month = 1 , day = 5 ) . timetuple ( ) ) #NEWLINE# t2 = time . mktime ( datetime ( year = 2012 , month = 2 , day = 13 ) . timetuple ( ) ) #NEWLINE# t3 = time . mktime ( datetime ( year = 2012 , month = 2 , day = 29 ) . timetuple ( ) ) #NEWLINE# t4 = time . mktime ( datetime ( year = 2012 , month = 3 , day = 5 ) . timetuple ( ) ) #NEWLINE# assert_equals ( DAY , gtd . step_size ( t0 ) ) #NEWLINE# assert_equals ( ( 31 * DAY ) , gtm . step_size ( t0 ) ) #NEWLINE# assert_equals ( ( 366 * DAY ) , gty . step_size ( t0 ) ) #NEWLINE# assert_equals ( DAY , gtd . step_size ( t2 ) ) #NEWLINE# assert_equals ( ( 31 * DAY ) , gtm . step_size ( t0 , t1 ) ) #NEWLINE# assert_equals ( ( 60 * DAY ) , gtm . step_size ( t1 , t2 ) ) #NEWLINE# assert_equals ( ( 29 * DAY ) , gtm . step_size ( t2 , t3 ) ) #NEWLINE# assert_equals ( ( 91 * DAY ) , gtm . step_size ( t1 , t4 ) ) #NEWLINE# assert_equals ( ( 60 * DAY ) , gtm . step_size ( t2 , t4 ) ) #NEWLINE# t0 = time . mktime ( datetime ( year = 2013 , month = 1 , day = 1 ) . timetuple ( ) ) #NEWLINE# t1 = time . mktime ( datetime ( year = 2013 , month = 1 , day = 5 ) . timetuple ( ) ) #NEWLINE# t2 = time . mktime ( datetime ( year = 2013 , month = 2 , day = 13 ) . timetuple ( ) ) #NEWLINE# t3 = time . mktime ( datetime ( year = 2013 , month = 2 , day = 28 ) . timetuple ( ) ) #NEWLINE# t4 = time . mktime ( datetime ( year = 2013 , month = 3 , day = 5 ) . timetuple ( ) ) #NEWLINE# assert_equals ( DAY , gtd . step_size ( t0 ) ) #NEWLINE# assert_equals ( ( 31 * DAY ) , gtm . step_size ( t0 ) ) #NEWLINE# assert_equals ( ( 365 * DAY ) , gty . step_size ( t0 ) ) #NEWLINE# assert_equals ( DAY , gtd . step_size ( t2 ) ) #NEWLINE# assert_equals ( ( 31 * DAY ) , gtm . step_size ( t0 , t1 ) ) #NEWLINE# assert_equals ( ( 59 * DAY ) , gtm . step_size ( t1 , t2 ) ) #NEWLINE# assert_equals ( ( 28 * DAY ) , gtm . step_size ( t2 , t3 ) ) #NEWLINE# assert_equals ( ( 90 * DAY ) , gtm . step_size ( t1 , t4 ) ) #NEWLINE# assert_equals ( ( 59 * DAY ) , gtm . step_size ( t2 , t4 ) )