#NEWLINE# def test_discrete_bounder( self ) : #NEWLINE# #INDENT# a = inspyred . ec . DiscreteBounder ( [ 1 , 3 , 7 , 15 ] ) #NEWLINE# b = inspyred . ec . DiscreteBounder ( [ 0 , 1 ] ) #NEWLINE# w = a ( [ 7 , 3 , 1 , 1 , 15 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# x = a ( [ 2 , 5 , 9 , 11 , 13 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# y = a ( [ ( - 2 ) , 16 , 10 , 1.5 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# z = b ( [ ( - 1 ) , 0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1 , 2 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( a == [ 7 , 3 , 1 , 1 , 15 ] ) #NEWLINE# assert ( x == [ 1 , 3 , 7 , 7 , 15 ] ) #NEWLINE# assert ( y == [ 1 , 15 , 7 , 1 ] ) #NEWLINE# assert ( z == [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ] )