#NEWLINE# def test_updating_below_min( self , duration1 , duration2 ) : #NEWLINE# #INDENT# global rec #NEWLINE# need_test = True #NEWLINE# try : #NEWLINE# #INDENT# a = ( 1.0 / duration1 ) #NEWLINE# b = ( 1.0 / duration2 ) #NEWLINE# #UNINDENT# except ZeroDivisionError : #NEWLINE# #INDENT# need_test = False #NEWLINE# #UNINDENT# if ( not need_test ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# node = CocosNode ( ) #NEWLINE# name1 = '1' #NEWLINE# name2 = '2' #NEWLINE# a1 = UIntervalAction ( name1 , duration1 ) #NEWLINE# a2 = UIntervalAction ( name2 , duration2 ) #NEWLINE# composite = ac . spawn ( a1 , a2 ) #NEWLINE# node . do ( composite ) #NEWLINE# elapsed = 0.0 #NEWLINE# min_duration = min ( duration1 , duration2 ) #NEWLINE# for next_elapsed in [ ( min_duration / 3.0 ) , ( min_duration / 2.0 ) ] : #NEWLINE# #INDENT# dt = ( next_elapsed - elapsed ) #NEWLINE# rec = [ ] #NEWLINE# node . _step ( dt ) #NEWLINE# rec = [ e for e in rec if ( e [ 1 ] != 'step' ) ] #NEWLINE# rec1 = [ e for e in rec if ( e [ 0 ] == name1 ) ] #NEWLINE# assert ( len ( rec1 ) == 1 ) #NEWLINE# assert ( ( rec1 [ 0 ] [ 1 ] == 'update' ) and ( abs ( ( rec1 [ 0 ] [ 2 ] - ( a1 / duration1 ) ) ) < fe ) ) #NEWLINE# rec2 = [ e for e in rec if ( e [ 0 ] == name2 ) ] #NEWLINE# assert ( len ( rec2 ) == 1 ) #NEWLINE# assert ( ( rec2 [ 0 ] [ 1 ] == 'update' ) and ( abs ( ( rec2 [ 0 ] [ 2 ] - ( next_elapsed / duration2 ) ) ) < fe ) ) #NEWLINE# elapsed = next_elapsed