summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-07-19 22:10:22 -0400
committerRob Crittenden <rcritten@redhat.com>2011-07-19 20:32:00 -0400
commite8c7eaf260d4515b9e31e8423d143a1e13e840cb (patch)
treee2b3385e4678d55fe282a2446814ff600d4c2d89 /tests
parentbcdd149bd1e0c4b33f5c2f4b153b1ead12695883 (diff)
downloadfreeipa-e8c7eaf260d4515b9e31e8423d143a1e13e840cb.tar.gz
freeipa-e8c7eaf260d4515b9e31e8423d143a1e13e840cb.tar.xz
freeipa-e8c7eaf260d4515b9e31e8423d143a1e13e840cb.zip
Set a default minimum value for class Int, handle long values better.
Allow a long to get as far as the min/max constraints where we can compare it to min/max int values and reject with a proper error message. https://fedorahosted.org/freeipa/ticket/1494
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ipalib/test_parameters.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_ipalib/test_parameters.py b/tests/test_ipalib/test_parameters.py
index 9e840176f..c08202901 100644
--- a/tests/test_ipalib/test_parameters.py
+++ b/tests/test_ipalib/test_parameters.py
@@ -33,7 +33,7 @@ from ipalib import parameters, text, errors, config
from ipalib.constants import TYPE_ERROR, CALLABLE_ERROR, NULLS
from ipalib.errors import ValidationError
from ipalib import _
-from xmlrpclib import MAXINT
+from xmlrpclib import MAXINT, MININT
class test_DefaultFrom(ClassChecker):
"""
@@ -1164,7 +1164,7 @@ class test_Int(ClassChecker):
o = self.cls('my_number')
assert o.type is int
assert isinstance(o, parameters.Int)
- assert o.minvalue is None
+ assert o.minvalue == int(MININT)
assert o.maxvalue == int(MAXINT)
# Test when min > max:
@@ -1194,7 +1194,7 @@ class test_Int(ClassChecker):
rule(dummy, value),
translation % dict(minvalue=3)
)
- assert dummy.message == 'must be at least %(minvalue)d'
+ assert dummy.message == 'can be at least %(minvalue)d'
assert dummy.called() is True
dummy.reset()