#NEWLINE# def test_colors( self ) : #NEWLINE# #INDENT# data = [ ( 'red' , 5 ) , ( 'blue' , 1 ) , ( 'yellow' , 8 ) , ( 'black' , 0 ) ] #NEWLINE# data . sort ( key = ( lambda r : r [ 1 ] ) ) #NEWLINE# keys = [ r [ 1 ] for r in data ] #NEWLINE# bisect_left = self . module . bisect_left #NEWLINE# self . assertEqual ( r [ bisect_left ( keys , 0 ) ] , ( 'black' , 0 ) ) #NEWLINE# self . assertEqual ( data [ bisect_left ( keys , 1 ) ] , ( 'blue' , 1 ) ) #NEWLINE# self . assertEqual ( data [ bisect_left ( keys , 5 ) ] , ( 'red' , 5 ) ) #NEWLINE# self . assertEqual ( data [ bisect_left ( keys , 8 ) ] , ( 'yellow' , 8 ) )