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 | |
parent | 322d8238a0862355340e1ad9a464bd40f6e9b728 (diff) | |
download | freeipa-22493eef216a587bf076f81e558c476b6dd513bf.tar.gz freeipa-22493eef216a587bf076f81e558c476b6dd513bf.tar.xz freeipa-22493eef216a587bf076f81e558c476b6dd513bf.zip |
Fix three broken unit tests
-rw-r--r-- | ipalib/backend.py | 1 | ||||
-rw-r--r-- | ipalib/cli.py | 3 | ||||
-rw-r--r-- | ipalib/parameters.py | 15 |
3 files changed, 9 insertions, 10 deletions
diff --git a/ipalib/backend.py b/ipalib/backend.py index da7fc2922..b123ed140 100644 --- a/ipalib/backend.py +++ b/ipalib/backend.py @@ -118,6 +118,7 @@ class Executioner(Backend): 'non-public: %s: %s', e.__class__.__name__, str(e) ) error = InternalError() + destroy_context() if error is None: return result assert isinstance(error, PublicError) diff --git a/ipalib/cli.py b/ipalib/cli.py index 07e540edc..3258556b9 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -246,8 +246,7 @@ class textui(backend.Backend): dn: dc=example,dc=com >>> attr = 'objectClass' >>> ui.print_attribute(attr, [u'top', u'someClass']) - objectClass: top - objectClass: someClass + objectClass: top, someClass """ assert isinstance(attr, basestring) if not isinstance(value, (list, tuple)): diff --git a/ipalib/parameters.py b/ipalib/parameters.py index d9e33f8ad..1b3b2b719 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) - |