diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-28 05:06:13 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-28 05:06:13 +0000 |
commit | 07ac867ed39b9539c4667bf51ef32778e5fb01df (patch) | |
tree | 03cf496a960feca695021e01ab2228c96917356e /ipalib/ipa_types.py | |
parent | b865b30511316f2874de6c95b648e6f653f5a46c (diff) | |
download | freeipa-07ac867ed39b9539c4667bf51ef32778e5fb01df.tar.gz freeipa-07ac867ed39b9539c4667bf51ef32778e5fb01df.tar.xz freeipa-07ac867ed39b9539c4667bf51ef32778e5fb01df.zip |
214: Added ipa_types.Bool.validate() method; added corresponding unit tests
Diffstat (limited to 'ipalib/ipa_types.py')
-rw-r--r-- | ipalib/ipa_types.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ipalib/ipa_types.py b/ipalib/ipa_types.py index ff62af22e..670c4dd64 100644 --- a/ipalib/ipa_types.py +++ b/ipalib/ipa_types.py @@ -102,6 +102,10 @@ class Bool(Type): return False return None + def validate(self, value): + if not (value is True or value is False): + return 'Must be %r or %r' % (self.true, self.false) + class Int(Type): def __init__(self, min_value=None, max_value=None): |