diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-08-04 00:21:26 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-08-04 00:21:26 -0600 |
commit | 22493eef216a587bf076f81e558c476b6dd513bf (patch) | |
tree | a2f2438065fa43849451dbb6c3fbd6be31878d74 /ipalib/parameters.py | |
parent | 322d8238a0862355340e1ad9a464bd40f6e9b728 (diff) | |
download | freeipa-22493eef216a587bf076f81e558c476b6dd513bf.tar.gz freeipa-22493eef216a587bf076f81e558c476b6dd513bf.tar.xz freeipa-22493eef216a587bf076f81e558c476b6dd513bf.zip |
Fix three broken unit tests
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index d9e33f8a..1b3b2b71 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -261,13 +261,6 @@ class Param(ReadOnly): self.name = check_name(name) self.nice = '%s(%r)' % (self.__class__.__name__, self.param_spec) - if 'cli_short_name' in kw: - if len(kw['cli_short_name']) != 1: - raise TypeError( - '%s: cli_short_name can only be a single character: %s' - % (self.nice, kw['cli_short_name']) - ) - # Add 'default' to self.kwargs and makes sure no unknown kw were given: assert type(self.type) is type if kw.get('multivalue', True): @@ -360,6 +353,13 @@ class Param(ReadOnly): '%s: rules must be callable; got %r' % (self.nice, rule) ) + # Check that cli_short_name is only 1 character long: + if not (self.cli_short_name is None or len(self.cli_short_name) == 1): + raise ValueError( + '%s: cli_short_name can only be a single character: %s' % ( + self.nice, self.cli_short_name) + ) + # And we're done. lock(self) @@ -1244,4 +1244,3 @@ def create_param(spec): TYPE_ERROR % ('spec', (str, Param), spec, type(spec)) ) return Str(spec) - |