summaryrefslogtreecommitdiffstats
path: root/ipalib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/tests')
-rw-r--r--ipalib/tests/test_ipa_types.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipalib/tests/test_ipa_types.py b/ipalib/tests/test_ipa_types.py
index 37546d9e..5d31b844 100644
--- a/ipalib/tests/test_ipa_types.py
+++ b/ipalib/tests/test_ipa_types.py
@@ -126,6 +126,15 @@ class test_Bool(ClassChecker):
# value is not be converted, so None is returned
assert o(value) is None
+ def test_validate(self):
+ t = 'For sure!'
+ f = 'No way!'
+ o = self.cls(true=t, false=f)
+ assert o.validate(True) is None
+ assert o.validate(False) is None
+ for value in (t, f, 0, 1, 'True', 'False', 'Yes', 'No'):
+ assert o.validate(value) == 'Must be %r or %r' % (t, f)
+
class test_Int(ClassChecker):
_cls = ipa_types.Int