summaryrefslogtreecommitdiffstats
path: root/ipalib/tests
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-11 19:35:57 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-11 19:35:57 +0000
commit92824182911007ce3e9cf4f858f70434594ee5dd (patch)
tree511111922021c30297cd3aa3f88144c5e7161e8d /ipalib/tests
parent5313e5a491ceefe866a287cb4c320f0fee0474e2 (diff)
downloadfreeipa.git-92824182911007ce3e9cf4f858f70434594ee5dd.tar.gz
freeipa.git-92824182911007ce3e9cf4f858f70434594ee5dd.tar.xz
freeipa.git-92824182911007ce3e9cf4f858f70434594ee5dd.zip
110: Started fleshing out more in cli.py
Diffstat (limited to 'ipalib/tests')
-rw-r--r--ipalib/tests/test_cli.py19
-rw-r--r--ipalib/tests/test_public.py7
2 files changed, 26 insertions, 0 deletions
diff --git a/ipalib/tests/test_cli.py b/ipalib/tests/test_cli.py
index 91bc0a29..b47aff3a 100644
--- a/ipalib/tests/test_cli.py
+++ b/ipalib/tests/test_cli.py
@@ -21,6 +21,7 @@
Unit tests for `ipalib.cli` module.
"""
+from tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker
from ipalib import cli
@@ -34,3 +35,21 @@ def test_from_cli():
f = cli.from_cli
assert f('initialize') == 'initialize'
assert f('user-add') == 'user_add'
+
+
+class test_CLI(ClassChecker):
+ """
+ Tests the `CLI` class.
+ """
+ _cls = cli.CLI
+
+ def test_class(self):
+ assert type(self.cls.api) is property
+
+ def test_api(self):
+ """
+ Tests the `api` property.
+ """
+ api = 'the plugable.API instance'
+ o = self.cls(api)
+ assert read_only(o, 'api') is api
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 81401859..d6f3dbbe 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -267,6 +267,13 @@ class test_cmd(ClassChecker):
sub.validate(**okay)
raises(errors.RuleError, sub.validate, **fail)
+ def test_execute(self):
+ """
+ Tests the `execute` method.
+ """
+ assert 'execute' in self.cls.__public__ # Public
+
+
def test_obj():
cls = public.obj