#NEWLINE# def test_wait_for_condition_success( self ) : #NEWLINE# #INDENT# lights = TrafficLights ( colour = 'Green' ) #NEWLINE# t = threading . Thread ( target = t . make_random_changes , args = ( 2 , ) ) #NEWLINE# t . start ( ) #NEWLINE# wait_for_condition ( condition = ( lambda l : ( l . colour == 'Red' ) ) , obj = lights , trait = 'colour' ) #NEWLINE# self . assertEqual ( lights . colour , 'Red' ) #NEWLINE# t . join ( )