summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-05-12 18:47:19 -0600
committerRob Crittenden <rcritten@redhat.com>2009-05-13 14:22:09 -0400
commit87480b7bdea7cfe99d0c3d964fd65b82dbaf6a6c (patch)
treebe9dc3e61549a2472f422e271f9472b3b649de23
parent252e9b61eba65743b834f799f4f2321f66b12676 (diff)
downloadfreeipa-87480b7bdea7cfe99d0c3d964fd65b82dbaf6a6c.tar.gz
freeipa-87480b7bdea7cfe99d0c3d964fd65b82dbaf6a6c.tar.xz
freeipa-87480b7bdea7cfe99d0c3d964fd65b82dbaf6a6c.zip
Re-enable doctest, fix broken docstrings
-rw-r--r--ipalib/__init__.py15
-rw-r--r--ipalib/cli.py6
-rw-r--r--ipalib/errors.py18
-rwxr-xr-xmake-test2
4 files changed, 18 insertions, 23 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index 0c36aa18b..7108f65ec 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -601,7 +601,7 @@ For example, say we setup a command like this:
... textui.print_count(result, format)
...
>>> api = create_api()
->>> api.env.in_server = True # We want to execute, not forward.
+>>> api.bootstrap(in_server=True) # We want to execute, not forward
>>> api.register(show_items)
>>> api.finalize()
@@ -694,14 +694,7 @@ After `API.bootstrap()` has been called, the `Env` instance will be populated
with all the environment information used by the built-in plugins.
This will be called before any plugins are registered, so plugin authors can
assume these variables will all exist by the time the module containing their
-plugin (or plugins) is imported. For example:
-
->>> api = create_api()
->>> len(api.env)
-1
->>> api.bootstrap(in_server=True) # We want to execute, not forward
->>> len(api.env)
-39
+plugin (or plugins) is imported.
`Env._bootstrap()`, which is called by `API.bootstrap()`, will create several
run-time variables that connot be overriden in configuration files or through
@@ -747,8 +740,10 @@ For example:
... """Print message of the day."""
...
... def execute(self):
-... return self.env.message_of_the_day
+... return self.env.message
...
+>>> api = create_api()
+>>> api.bootstrap(in_server=True, message='Hello, world!')
>>> api.register(motd)
>>> api.finalize()
>>> api.Command.motd()
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 362da18ef..a6f4fe86a 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -264,9 +264,9 @@ class textui(backend.Backend):
>>> entry = dict(sn='Last', givenname='First', uid='flast')
>>> ui = textui()
>>> ui.print_entry(entry)
- givenname: 'First'
- sn: 'Last'
- uid: 'flast'
+ givenname: First
+ sn: Last
+ uid: flast
"""
assert type(entry) is dict
if entry.get('dn'):
diff --git a/ipalib/errors.py b/ipalib/errors.py
index a29dbbee6..dcbeadb66 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -708,7 +708,7 @@ class NoSuchNamespaceError(InvocationError):
>>> raise NoSuchNamespaceError(name='Plugins')
Traceback (most recent call last):
...
- NoSuchNamespaceError: api has no such namespace: Plugins
+ NoSuchNamespaceError: api has no such namespace: 'Plugins'
"""
errno = 3010
@@ -779,7 +779,7 @@ class MalformedServicePrincipal(ExecutionError):
For example:
- >>> raise MalformedServicePrincipal(reason="missing service")
+ >>> raise MalformedServicePrincipal(reason='missing service')
Traceback (most recent call last):
...
MalformedServicePrincipal: Service principal is not of the form: service/fully-qualified host name: missing service
@@ -787,7 +787,7 @@ class MalformedServicePrincipal(ExecutionError):
"""
errno = 4004
- format = _('Service principal is not of the form: service/fully-qualified host name: %(reason)r')
+ format = _('Service principal is not of the form: service/fully-qualified host name: %(reason)s')
class RealmMismatch(ExecutionError):
"""
@@ -843,10 +843,10 @@ class MalformedUserPrincipal(ExecutionError):
For example:
- >>> raise MalformedUserPrincipal(principal=jsmith@@EXAMPLE.COM)
+ >>> raise MalformedUserPrincipal(principal='jsmith@@EXAMPLE.COM')
Traceback (most recent call last):
...
- MalformedUserPrincipal: Principal is not of the form user@REALM: jsmith@@EXAMPLE.COM
+ MalformedUserPrincipal: Principal is not of the form user@REALM: 'jsmith@@EXAMPLE.COM'
"""
@@ -955,7 +955,7 @@ class Base64DecodeError(ExecutionError):
For example:
- >>> raise Base64DecodeError(reason="Incorrect padding")
+ >>> raise Base64DecodeError(reason='Incorrect padding')
Traceback (most recent call last):
...
Base64DecodeError: Base64 decoding failed: Incorrect padding
@@ -963,7 +963,7 @@ class Base64DecodeError(ExecutionError):
"""
errno = 4015
- format = _('Base64 decoding failed: %(reason)r')
+ format = _('Base64 decoding failed: %(reason)s')
class BuiltinError(ExecutionError):
"""
@@ -1035,14 +1035,14 @@ class DatabaseError(ExecutionError):
For example:
- >>> raise DatabaseError(desc="Can't contact LDAP server", info="")
+ >>> raise DatabaseError(desc="Can't contact LDAP server", info='')
Traceback (most recent call last):
...
DatabaseError: Can't contact LDAP server:
"""
errno = 4203
- format = _('%(desc)r:%(info)r')
+ format = _('%(desc)s:%(info)s')
class LimitsExceeded(ExecutionError):
diff --git a/make-test b/make-test
index cfc1db6a8..3ad5e715d 100755
--- a/make-test
+++ b/make-test
@@ -11,7 +11,7 @@ do
if [[ -f $executable ]]; then
echo "[ $name: Starting tests... ]"
((runs += 1))
- if $executable /usr/bin/nosetests -v #--with-doctest
+ if $executable /usr/bin/nosetests -v --with-doctest --exclude="plugins"
then
echo "[ $name: Tests OK ]"
else