#NEWLINE# def test_value_between( ) : #NEWLINE# #INDENT# i = integer_scalar ( 1 ) #NEWLINE# V = ValueBetween #NEWLINE# assert V ( 0 , 2 ) . validate ( i , None ) #NEWLINE# assert V ( 0 , 1 , inclusive = True ) . validate ( i , None ) #NEWLINE# assert V ( 1 , 2 , inclusive = True ) . validate ( i , None ) #NEWLINE# assert ( not V ( 2 , 3 ) . validate ( i , None ) ) #NEWLINE# assert ( i . errors == [ 'test must be in the range 2 to 3.' ] ) #NEWLINE# i . errors = [ ] #NEWLINE# assert ( not V ( ( - 1 ) , 0 ) . validate ( i , None ) ) #NEWLINE# assert ( i . errors == [ 'test must be in the range -1 to 0.' ] ) #NEWLINE# i . errors = [ ] #NEWLINE# assert ( not V ( 1 , 2 , inclusive = False ) . validate ( i , None ) ) #NEWLINE# assert ( i . errors == [ 'test must be greater than 1 and less than 2.' ] ) #NEWLINE# i . errors = [ ] #NEWLINE# assert ( not V ( 0 , 1 , inclusive = False ) . validate ( i , None ) ) #NEWLINE# assert ( i . errors == [ 'test must be greater than 0 and less than 1.' ] )