summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-17 23:08:52 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-17 23:08:52 -0700
commit4f24f0fd8837383f4a2abc54946f6f84810807b8 (patch)
treefe210ce86abd11f693a628ff4f4fd43250fd77df /tests/test_ipalib/test_plugable.py
parent171ed58367e58c59f9f67ef831f08ce80ba8508b (diff)
downloadfreeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.gz
freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.tar.xz
freeipa-4f24f0fd8837383f4a2abc54946f6f84810807b8.zip
Plugin.doc instance attribute is now parsed out using inspect.getdoc(); added Plugin.summary instance attribute, created in Plugin.__init__()
Diffstat (limited to 'tests/test_ipalib/test_plugable.py')
-rw-r--r--tests/test_ipalib/test_plugable.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/test_ipalib/test_plugable.py b/tests/test_ipalib/test_plugable.py
index 02df058b8..21c712809 100644
--- a/tests/test_ipalib/test_plugable.py
+++ b/tests/test_ipalib/test_plugable.py
@@ -21,6 +21,7 @@
Test the `ipalib.plugable` module.
"""
+import inspect
from tests.util import raises, no_set, no_del, read_only
from tests.util import getitem, setitem, delitem
from tests.util import ClassChecker, create_test_api
@@ -313,7 +314,7 @@ class test_Plugin(ClassChecker):
assert o.name == 'Plugin'
assert o.module == 'ipalib.plugable'
assert o.fullname == 'ipalib.plugable.Plugin'
- assert o.doc == self.cls.__doc__
+ assert o.doc == inspect.getdoc(self.cls)
class some_subclass(self.cls):
"""
Do sub-classy things.
@@ -321,12 +322,20 @@ class test_Plugin(ClassChecker):
Although it doesn't know how to comport itself and is not for mixed
company, this class *is* useful as we all need a little sub-class
now and then.
+
+ One more paragraph.
"""
o = some_subclass()
assert o.name == 'some_subclass'
assert o.module == __name__
assert o.fullname == '%s.some_subclass' % __name__
- assert o.doc == some_subclass.__doc__
+ assert o.doc == inspect.getdoc(some_subclass)
+ assert o.summary == 'Do sub-classy things.'
+ class another_subclass(self.cls):
+ pass
+ o = another_subclass()
+ assert o.doc is None
+ assert o.summary == '<%s>' % o.fullname
def test_implements(self):
"""