diff options
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 0d764d60..7cc93e90 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -934,6 +934,16 @@ class BytesEnum(Enum): class StrEnum(Enum): """ Enumerable for Unicode text (stored in the ``unicode`` type). + + For example: + + >>> enum = StrEnum('my_enum', values=(u'One', u'Two', u'Three')) + >>> enum.validate(u'Two') is None + True + >>> enum.validate(u'Four') + Traceback (most recent call last): + ... + ValidationError: invalid 'my_enum': must be one of (u'One', u'Two', u'Three') """ type = unicode |