diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-13 02:34:36 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-13 02:34:36 +0000 |
commit | 0fed74b56d1940f84e7b64c3661f21baabcb4616 (patch) | |
tree | 2c6ed1f682f9d39f8a3e80c5d3bad17bf0920181 /ipalib/tests/test_plugable.py | |
parent | 69f7132365c4f369068b8e09921cd29ea92f3754 (diff) | |
download | freeipa.git-0fed74b56d1940f84e7b64c3661f21baabcb4616.tar.gz freeipa.git-0fed74b56d1940f84e7b64c3661f21baabcb4616.tar.xz freeipa.git-0fed74b56d1940f84e7b64c3661f21baabcb4616.zip |
138: Added ProxyTarget.doc property; CLI.print_commands() now uses cmd.doc instead of cmd.get_doc()
Diffstat (limited to 'ipalib/tests/test_plugable.py')
-rw-r--r-- | ipalib/tests/test_plugable.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 89bb948e..ba90c203 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -126,7 +126,7 @@ class test_ProxyTarget(ClassChecker): def test_name(self): """ - Test the `name` property. + Tests the `name` property. """ assert read_only(self.cls(), 'name') == 'ProxyTarget' @@ -134,9 +134,17 @@ class test_ProxyTarget(ClassChecker): pass assert read_only(some_subclass(), 'name') == 'some_subclass' + def test_doc(self): + """ + Tests the `doc` property. + """ + class some_subclass(self.cls): + 'here is the doc string' + assert read_only(some_subclass(), 'doc') == 'here is the doc string' + def test_implements(self): """ - Test the `implements` classmethod. + Tests the `implements` classmethod. """ class example(self.cls): __public__ = frozenset(( @@ -263,6 +271,7 @@ class test_Proxy(ClassChecker): class plugin(base): name = 'user_add' attr_name = 'add' + doc = 'add a new user' # Test that TypeError is raised when base is not a class: raises(TypeError, self.cls, base(), None) @@ -273,7 +282,8 @@ class test_Proxy(ClassChecker): # Test with correct arguments: i = plugin() p = self.cls(base, i) - assert read_only(p, 'name') == 'user_add' + assert read_only(p, 'name') is plugin.name + assert read_only(p, 'doc') == plugin.doc assert list(p) == sorted(base.__public__) # Test normal methods: @@ -304,6 +314,7 @@ class test_Proxy(ClassChecker): class base(object): __public__ = frozenset() name = 'base' + doc = 'doc' @classmethod def implements(cls, arg): return arg + 7 @@ -329,6 +340,7 @@ class test_Proxy(ClassChecker): __public__ = frozenset() class sub(base): name = 'some_name' + doc = 'doc' label = 'another_name' p = self.cls(base, sub()) @@ -389,6 +401,7 @@ class test_NameSpace(ClassChecker): __public__ = frozenset(( 'plusplus', )) + doc = 'doc' def plusplus(self, n): return n + 1 |