#NEWLINE# def testSegmentSegmentCollision( self ) : #NEWLINE# #INDENT# s = p . Space ( ) #NEWLINE# b1 = p . Body ( 10 , 10 ) #NEWLINE# b2 = p . Body ( 10 , 10 ) #NEWLINE# c1 = p . Segment ( b1 , ( ( - 1 ) , ( - 1 ) ) , ( 1 , 1 ) , 1 ) #NEWLINE# c2 = p . Segment ( b2 , ( 1 , ( - 1 ) ) , ( ( - 1 ) , 1 ) , 1 ) #NEWLINE# s . add ( b1 , b2 , c1 , c2 ) #NEWLINE# self . num_of_begins = 0 #NEWLINE# def begin( space , arb ) : #NEWLINE# #INDENT# self . num_of_begins += 1 #NEWLINE# return True #NEWLINE# #UNINDENT# s . set_default_collision_handler ( begin = begin ) #NEWLINE# s . step ( 0.1 ) #NEWLINE# self . assertEqual ( 1 , self . num_of_begins )